Skip to main content
POST
/
sale
cURL
curl --request POST \
  --url https://firstpromoter.com/api/v1/track/sale \
  --header 'X-API-KEY: <api-key>'
{
  "id": 33847194,
  "type": "sale",
  "amount_cents": 1000,
  "reward": {
    "id": 10940014,
    "status": "approved",
    "amount": 200,
    "unit": "cash",
    "created_at": "2024-09-11T14:22:12.160Z",
    "lead": {
      "id": 20738339,
      "state": "cancelled",
      "email": "hello@testmintli.com",
      "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",
    "conversion_amount": 1000,
    "tier_level": 1,
    "split_type": null
  },
  "lead": {
    "id": 20738339,
    "state": "cancelled",
    "email": "hello@testmintli.com",
    "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": "peluwydo@mailinator.com",
    "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

X-API-KEY
string
header
required

Query Parameters

email
string

required if uid is null

Email of the lead/sign-up

uid
string

required if email is null

uid of the lead added on signup tracking

event_id
string
required

Transaction or sale event ID. It's required to avoid generating duplicate sales in case you mistakenly send the same API call multiple times.

amount
string
required

The sale amount in cents. It's used to calculate commissions/rewards.

For zero-decimal currencies like JPY, amount and mrr parameters should be sent as whole values.

For other currencies, amount and mrr parameter values should be in cents, i.e., you will need to multiply the value by 100 before sending the request.

quantity
string

Number of subscriptions/items refunded. If it's only one you can skip this parameter.

plan
string

Customer plan ID from the billing provider. It's used to calculate rewards in case you use plan-level rewards feature.

currency
string

This field is only required if the currency of the sale 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.

mrr
string

Sets the Monthly Recurring Revenue generated by the customer. It's used only for calculating the MRR generated by the program, not for calculating the commissions.

promo_code
string

For promo code/coupon code tracking. If you gave a unique coupon to a promoter and you added it on his promotion, you can pass it here and it will CREATE a new lead and a sale for that promoter (if it doesn't exist already).

tid
string

You can avoid a signup tracking call by providing the _fprom_tid cookie value (visitor tracking id) read on your system

ref_id
string

You can avoid signup tracking call by providing the ref_id(referral id) of the promoter

skip_email_notification
boolean

Set this to true to skip email notifications. Default is false.

created_at
string<date-time>

ISO 8601 date string of when the sale occurred. Defaults to now.

subscription_id
string

Subscription ID from your billing provider. Stored in the lead metadata.

start_recurring_reward_in
integer

Number of days to delay the first commission. The sale will be scheduled and tracked at now + start_recurring_reward_in days.

recurring_reward_frequency
integer

Interval in days between recurring commission events. Used together with start_recurring_reward_in.

max_recurring
integer

Maximum number of recurring commission events to generate. Requires recurring_reward_frequency to be set.

ecom_sale
boolean

Set to true for e-commerce one-time sales (non-subscription).

Response

Sale tracked successfully

id
integer
Example:

33847194

type
string
Example:

"sale"

amount_cents
integer
Example:

1000

reward
object
lead
object
promoter
object