Skip to main content
Use the affiliate endpoints to sync your partner programme with your own systems: list partners, track attributed orders, and follow payouts.
Your store must be approved for the affiliate programme. Apply in the dashboard under Affiliates. Until then, every affiliate endpoint returns 403 with code FEATURE_NOT_ENABLED.

Endpoints

Approving partners, reviewing flagged conversions, and sending payouts stay in the dashboard.

Amounts and IDs

  • Amounts in API responses are integers in minor units. commission: 499 in USD is $4.99.
  • Webhook payloads use major units. commission: 4.99 is $4.99.
  • Partners and payouts use 16-character public IDs. Conversions use the order’s public invoice_id.

Pagination

List endpoints return 25 items per page with a next_cursor. Pass it back as cursor to get the next page. next_cursor is null on the last page.
Each list also returns counts, the number of records per status:

Invite a partner

Response (201)
Read-only keys cannot invite partners.

How orders are attributed

An order is credited to a partner in one of these ways, in priority order:
  1. Partner coupon. The buyer used a coupon bound to the partner.
  2. Tracking link. The buyer opened a partner link: https://your-store.com/any-page?ref=CODE or https://your-store.com/r/CODE. The storefront remembers the click for the programme’s cookie window.
  3. API. You passed affiliateCode when creating the invoice. The conversion has source: "api".
The conversion is rejected when the buyer is the partner, or when another coupon is used and the programme does not allow coupon stacking. It is flagged for review when the order has a high fraud score or the partner gets an unusual number of orders in a short time.

Commission states

Refunds reverse the commission automatically. commission is always the net amount.

Webhooks

Subscribe to these events in Developers › Webhooks. They use the same envelope and PapelShip-Signature header as order events.
affiliate.conversion
affiliate.payout_sent

Errors

Affiliate errors include a machine-readable code: