POST
/
refund
cURL
curl --request POST \
  --url https://v2.firstpromoter.com/api/v2/track/refund \
  --header 'Account-ID: <account-id>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "<string>",
  "uid": "<string>",
  "event_id": "<string>",
  "amount": "<string>",
  "currency": "<string>",
  "quantity": "<string>",
  "sale_event_id": "<string>",
  "skip_email_notification": true
}'
{
  "id": 33847726,
  "type": "refund",
  "amount_cents": -1000,
  "reward": {
    "id": 10940148,
    "status": "approved",
    "amount": -200,
    "unit": "cash",
    "created_at": "2024-09-11T14:36:01.016Z",
    "lead": {
      "id": 20738339,
      "state": "cancelled",
      "email": "[email protected]",
      "uid": null,
      "customer_since": "2024-09-11T14:22:12.160Z",
      "cancelled_at": "2024-09-11T15:07:46.174Z",
      "plan_name": null,
      "suspicion": "no_suspicion",
      "username": null,
      "website": null,
      "created_at": "2024-09-09T16:22:44.168Z",
      "split_promotion_id": null,
      "custom_fields": null,
      "split_percentage_value": null,
      "visitor_sub_id": null
    },
    "event_id": "test_sale_12340987_refund",
    "conversion_amount": -1000,
    "tier_level": 1,
    "split_type": null
  },
  "lead": {
    "id": 20738339,
    "state": "cancelled",
    "email": "[email protected]",
    "uid": null,
    "customer_since": "2024-09-11T14:22:12.160Z",
    "cancelled_at": "2024-09-11T15:07:46.174Z",
    "plan_name": null,
    "suspicion": "no_suspicion",
    "username": null,
    "website": null,
    "created_at": "2024-09-09T16:22:44.168Z",
    "split_promotion_id": null,
    "custom_fields": null,
    "split_percentage_value": null,
    "visitor_sub_id": null
  },
  "promoter": {
    "id": 3920164,
    "status": "active",
    "cust_id": "",
    "email": "[email protected]",
    "created_at": "2022-04-26T15:28:24.800Z",
    "temp_password": "xxxxxxxxxx",
    "default_promotion_id": 4210919,
    "pref": "db1znwe",
    "default_ref_id": "8yi2epelut",
    "note": "This is a note",
    "w8_form_url": null,
    "w9_form_url": null,
    "parent_promoter_id": 577918,
    "earnings_balance": {
      "cash": 50744
    },
    "current_balance": {
      "cash": 20044
    },
    "paid_balance": {
      "cash": 30700
    },
    "auth_token": "xxxxxxxxxxxxxx"
  }
}

Authorizations

Authorization
string
header
required

API key passed as a Bearer token in the Authorization header. You can find your API Key on Your FirstPromoter Dashboard. Navigate to Settings → Integrations section → Manage API Keys

Headers

Account-ID
string
required

Account id. You can find your Account ID on Your FirstPromoter Dashboard. Navigate to Settings → Integrations

Body

application/json
email
string
required

Email of the lead/sign-up. Required if uid is not provided.

event_id
string
required

Transaction or refund event ID. Required to avoid generating duplicate refunds.

amount
string
required

The refund amount in cents. Used to calculate negative commissions/rewards.

uid
string

uid of the lead added on signup tracking. Required if email is not provided.

currency
string

This field is only required if the currency of the sale/refund is not the same as the one set on FirstPromoter settings. We'll automatically convert the amount from this currency to the default one set on your FirstPromoter account.

quantity
string

Number of subscriptions/items refunded. Optional if quantity is 1.

sale_event_id
string

The event id of the sale for which the refund is processed. Should match the event_id from the sales tracking API call. Required for accurate tracking of multiple products or changing commission levels.

skip_email_notification
boolean

Set true to skip email notifications. Default is false.

Response

Success response

id
integer
Example:

33847726

type
string
Example:

"refund"

amount_cents
integer
Example:

-1000

reward
object
lead
object
promoter
object