Skip to content

Tracking

Sending server-side conversions

Report purchases, bookings, leads and refunds from your backend with a secret key.

Create a secret API key

Go to Integrations → API keys and create a key with the conversions:write scope. The full key is shown once — store it in your server's secret manager. Never put a secret key in front-end code.

Send a conversion

curl -X POST https://YOUR-APP-DOMAIN/api/v1/conversions \
  -H "Authorization: Bearer sk_live_..." \
  -H "Idempotency-Key: order-10045" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "purchase",
    "external_id": "10045",
    "click_id": "VALUE_OF_THE__aff_cid_COOKIE",
    "amount": 12500,
    "currency": "USD",
    "tax": 1000,
    "shipping": 500,
    "customer_id": "your-internal-customer-id"
  }'

Amounts are integers in the currency's minor unit (cents for USD, yen for JPY). Instead of a click ID you can pass coupon_code or referral_code.

Duplicates and retries

Each external_id is accepted once per event type, and repeating the same Idempotency-Key returns the original result. It is always safe to retry after a timeout.

Refunds and cancellations

Send POST /api/v1/conversions/refund with the original external_id and the refunded amount. Partial refunds reverse the commission proportionally; a full refund or cancellation reverses it completely.

Test mode

Use a sk_test_ key while integrating. Test conversions appear with a Test badge and never affect balances or payouts.