v1

latestOpenAPI 3.0.12026-08-062532117.6 KB

Update a sale

Updates a sale identified by saleId, and fires the sale.updated webhook.

commissionEarned is handled separately from the other fields: it updates the commission record for the affiliate credited with the sale, not the sale itself. Every other field you send is applied directly to the sale, so sending a field that is not listed below will fail the request.

put/sales

Request body

saleIdinteger required

The sale to update

namestring

Name of the customer

emailstring email

Email of the customer

totalEarnednumber float

Gross value of the sale

commissionRatenumber float

Commission rate recorded on the sale

commissionEarnednumber float

Sets the commission recorded for the credited affiliate. Applied to the commission record rather than the sale.

externalIdstring

The ID of this sale in your own system

externalInvoiceIdstring

The ID of the invoice in your own system

metadataobject

Arbitrary JSON to attach to the sale

Response

The updated sale, including its recalculated commissionEarned.

idinteger

The sale ID

affiliateIdstring uuid nullable

The affiliate credited with this sale

referralIdstring uuid nullable

The referral this sale belongs to

affiliateProgramIdstring uuid nullable

The affiliate program this sale belongs to

affiliateLinkIdstring uuid nullable

The affiliate link the sale was attributed to

promotionalCodeIdstring uuid nullable

The promotional code used on this sale, if any

externalIdstring nullable

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

externalInvoiceIdstring nullable

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

namestring nullable

Name of the customer

emailstring email nullable

Email of the customer

totalEarnednumber float

Gross value of the sale

commissionRatenumber float nullable

Commission rate applied to this sale

commissionEarnednumber float nullable

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.

taxAmountnumber float

Tax deducted before commission was calculated

shippingAmountnumber float

Shipping deducted before commission was calculated

productsBoughtstring[]

Product identifiers attached to this sale

clicksinteger

Clicks attributed to this sale

status'ACTIVE' | 'REFUNDED'

Whether the sale is live or has been refunded

refundedAtstring date-time nullable

When the sale was marked refunded

paymentTrigger'SIGNUP' | 'PURCHASE' | 'BONUS' | 'CONTENT_REWARD'

What triggered the commission for this sale

source'UNKNOWN' | 'API' | 'INTEGRATION' | 'MANUAL' | 'IMPORTED' | 'AUTOMATED'

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

metadataobject nullable

Arbitrary JSON you can attach to the sale

createdAtstring date-time

When the sale was recorded