Skip to main content

Partner Transactions

The Partner Transactions API lists affiliate purchase rows for the selected store: each sale, and each refund of a sale, in one currency.

Overview​

The Partner Transactions API provides one endpoint:

A partner transaction is one purchase row. A refund does not change the sale row. When the refund commission is not 0, it is a second item, with its own id, negative amount and commission_amount, and the same transaction_id as the sale. created_at on that refund item is when the refund was recorded. When the refund commission is 0, no refund item is written.

There is no get-one. transaction_id is the payment on Get Transaction. order_id is the order on Get Order.

Rows for the store referrer are omitted. Passing that partner, an archived partner, or an unknown partner as partner returns 404 — not an empty list.

Rows for archived partners are still listed when partner is omitted. On those rows ref is null, and partner_id returns 404 on Get Partner.

Endpoints​

MethodPathDescription
GET/partner-transactionsPaginated list in one currency. See Get Partner Transactions.

Sales and refunds​

type is sale or refund. Omit the filter to return both.

amount and commission_amount are signed integers in minor units (e.g. cents). Negative means a refund.

commission_percent is the percent stored on the row when it was recorded. It is an integer 0–100, where 20 means 20%, and it may be 0. It does not follow later edits to the partner or to the store default.

partner_name, ref, and variant_name are current values, not a snapshot. product_name is the name stored on the order. customer_id, customer_email, and customer_name are null when that customer is gone. The other related ids are null when the related record is gone.

Partner stats are not this list. Stats count only sale rows in sales_count, and they clamp amount and commission_amount at 0. This list still shows the negative refund rows.

Currency​

Every call requires currency. One call returns one currency, and each item still includes currency. The code must be one the store sells in — see Get Store → currencies. There is no default.

Partner Transaction Object​

FieldTypeNullableDescription
idstringNoThis row's UUID. A sale and its refund have different ids.
typestringNosale or refund.
amountintegerNoSigned amount in minor units (e.g. cents). Negative on a refund.
currencystringNoLowercase ISO-4217 code (e.g. usd).
commission_percentintegerNoPercent snapshotted on the row. Integer 0–100. 20 means 20%. May be 0.
commission_amountintegerNoSigned commission in minor units (e.g. cents). Negative on a refund.
created_atstringNoWhen the sale was recorded, or when the refund was recorded (ISO 8601).
partner_idstringYesPartner UUID. For an archived partner, Get Partner returns 404.
partner_namestringYesThe partner's current name.
refstringYesThe partner's current ?ref= slug. Null when the partner is archived.
customer_idstringYesCustomer UUID. Null when the customer is gone.
customer_emailstringYesCustomer email. Null when the customer is gone.
customer_namestringYesCustomer name. Null when the customer is gone.
product_idstringYesProduct UUID.
product_namestringYesProduct name snapshotted on the order.
variant_idstringYesVariant UUID.
variant_namestringYesThe variant's current name.
order_idstringYesOrder UUID. Pass it to Get Order.
transaction_idstringYesPayment UUID. A sale and its refund share this id. Pass it to Get Transaction.