API reference
Conversions
Report sales and reverse them.
Record a conversion
POST
/v1/conversionswrite scopeAttributes a completed order to an affiliate and records the commission. Call this from your checkout once payment is confirmed.
Body parameters
| orderIdreqstring | Your order id. Used for idempotency. |
| orderAmountCentsreqint | Order total in cents. |
| clickIduuid | From the tracking cookie. Most accurate. |
| referralCodestring | From `?ref=`. |
| couponCodestring | An affiliate's 1-to-1 code. |
| customerEmailstring | Enables self-referral blocking and lifetime attribution. |
| customerNamestring | Enables optional name-match fraud checks. |
| externalProductIdstring | Your product id. Enables per-product commission rules. |
| metadataobject | Stored verbatim. |
Response
json
{
"conversionId": "9d2f...",
"affiliateId": "c41a...",
"commissionCents": 5980,
"status": "pending"
}- Attribution priority: `clickId` → `referralCode` → `couponCode` → lifetime email. The first that resolves wins.
- Idempotent on `orderId` — a retry returns `409`, it does not double-credit.
- A 2-tier program creates a second conversion for the upline automatically. You do not report it.
Reverse a commission
POST
/v1/conversions/clawbackwrite scopeReverses commission after a refund, cancellation, or dispute. Call this when you refund an order.
Body parameters
| orderIdreqstring | The order being reversed. |
| reasonenum | `refund` · `cancellation` · `dispute` · `fraud` · `other`. Defaults to `refund`. |
| notestring | Free text kept on the record. |
Response
json
{
"orderId": "ord_10422",
"reversedCount": 2,
"reversedCommissionCents": 7180,
"alreadyPaidCents": 5980,
"reason": "refund"
}- A tier-2 MLM override is reversed alongside its parent — hence `reversedCount: 2` above.
- `alreadyPaidCents` is commission that had already been disbursed. Recover it out of band; this endpoint cannot un-pay it.