Create a Sale
Records a sale and pays out the resulting commission.
You must identify who the sale belongs to with one of referralId, email or promoCode. referralId is flexible: it accepts a referral UUID, an affiliate UUID, an affiliate link slug, or a numeric click ID. email matches an existing referral by email address.
totalEarned is required and must be non-zero. A customer name and email are also required — they are taken from the matched referral when you do not send them explicitly.
commissionRate overrides the affiliate’s rate for this sale only. tax and shipping are deducted before commission is calculated, but only when your program has the matching deduction setting enabled.
When you pass promoCode, the code is validated for existence, active state, expiry and redemption limits, and its redemption counters are incremented on success.
tax and shipping can be provided to exclude these amounts from the commission calculation. When the affiliate program has “Automatically deduct tax from commission calculation” or “Automatically deduct shipping from commission calculation” enabled, these amounts will be subtracted from the total before computing the affiliate’s commission.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The sale to record
Gross value of the sale. Must be non-zero.
Identifies who the sale belongs to. Accepts a referral UUID, an affiliate UUID, an affiliate link slug, or a numeric click ID. Required unless email or promoCode is supplied.
Email of the customer. Also used to match an existing referral. Required unless referralId or promoCode is supplied.
A promotional code belonging to the affiliate to credit. Required unless referralId or email is supplied. Validated for existence, active state, expiry and redemption limits; its redemption counters are incremented on success.
Name of the customer. Required unless it can be taken from the matched referral.
Overrides the affiliate's commission rate for this sale only. Defaults to the affiliate's own rate.
The ID of this sale in your own system. Must be unique within the program.
The ID of the invoice in your own system. Must be unique within the program.
A single product line for this sale
Tax to deduct before commission is calculated. Only applied when your program has tax deduction enabled.
Shipping to deduct before commission is calculated. Only applied when your program has shipping deduction enabled.
Response
The recorded sale. Returns null when no affiliate could be resolved from the details supplied — check the response before assuming a commission was created.
The sale ID
The affiliate credited with this sale
The referral this sale belongs to
The affiliate program this sale belongs to
The affiliate link the sale was attributed to
The promotional code used on this sale, if any
The ID of this sale in your own system. Unique per program.
The ID of the invoice in your own system. Unique per program.
Name of the customer
Email of the customer
Gross value of the sale
Commission rate applied to this sale
Commission recorded for the credited affiliate. Merged in by the API from the sale's commission record — it is not a column on the sale itself.
Tax deducted before commission was calculated
Shipping deducted before commission was calculated
Product identifiers attached to this sale
Clicks attributed to this sale
Whether the sale is live or has been refunded
ACTIVE, REFUNDED When the sale was marked refunded
What triggered the commission for this sale
SIGNUP, PURCHASE, BONUS, CONTENT_REWARD Where the sale came from. Sales created through this API have API.
UNKNOWN, API, INTEGRATION, MANUAL, IMPORTED, AUTOMATED Arbitrary JSON you can attach to the sale
When the sale was recorded