Skip to main content
POST
Create a sale
Optional fields 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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The sale to record

totalEarned
number<float>
required

Gross value of the sale. Must be non-zero.

referralId
string

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
string<email>

Email of the customer. Also used to match an existing referral. Required unless referralId or promoCode is supplied.

promoCode
string

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
string

Name of the customer. Required unless it can be taken from the matched referral.

commissionRate
number<float>

Overrides the affiliate's commission rate for this sale only. Defaults to the affiliate's own rate.

externalId
string

The ID of this sale in your own system. Must be unique within the program.

externalInvoiceId
string

The ID of the invoice in your own system. Must be unique within the program.

product
object

A single product line for this sale

tax
number<float>

Tax to deduct before commission is calculated. Only applied when your program has tax deduction enabled.

shipping
number<float>

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.

id
integer<int64>

The sale ID

affiliateId
string<uuid> | null

The affiliate credited with this sale

referralId
string<uuid> | null

The referral this sale belongs to

affiliateProgramId
string<uuid> | null

The affiliate program this sale belongs to

The affiliate link the sale was attributed to

promotionalCodeId
string<uuid> | null

The promotional code used on this sale, if any

externalId
string | null

The ID of this sale in your own system. Unique per program.

externalInvoiceId
string | null

The ID of the invoice in your own system. Unique per program.

name
string | null

Name of the customer

email
string<email> | null

Email of the customer

totalEarned
number<float>

Gross value of the sale

commissionRate
number<float> | null

Commission rate applied to this sale

commissionEarned
number<float> | null

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.

taxAmount
number<float>

Tax deducted before commission was calculated

shippingAmount
number<float>

Shipping deducted before commission was calculated

productsBought
string[]

Product identifiers attached to this sale

clicks
integer

Clicks attributed to this sale

status
enum<string>

Whether the sale is live or has been refunded

Available options:
ACTIVE,
REFUNDED
refundedAt
string<date-time> | null

When the sale was marked refunded

paymentTrigger
enum<string>

What triggered the commission for this sale

Available options:
SIGNUP,
PURCHASE,
BONUS,
CONTENT_REWARD
source
enum<string>

Where the sale came from. Sales created through this API have API.

Available options:
UNKNOWN,
API,
INTEGRATION,
MANUAL,
IMPORTED,
AUTOMATED
metadata
object | null

Arbitrary JSON you can attach to the sale

createdAt
string<date-time>

When the sale was recorded

Last modified on July 20, 2026