Prerequisites
- An affiliate program on your store, created from the Affiliate Hub.
- An API key with the right scopes: reading affiliate data requires
affiliates:read, creating invitations requiresaffiliates:write. Keys created with Full access cover both, including scopes added after the key was created.
All endpoints work in both test and live mode — use your test-mode API key while integrating.
Responses carry a
mode field so you always know which environment you are looking at.1. Invite partners programmatically
Create an invitation from your own backend — for example when someone fills in a “become a partner” form on your site, or when you sync partners from your CRM:program_id is optional — when omitted, the invitation is created for your store’s affiliate program. Pass it explicitly if your store runs more than one program.
A few behaviors to design around:
Track the lifecycle of your invitations with List affiliate invites — each invitation carries a
status of pending, accepted, canceled, or rejected.
2. How sales get attributed
A sale is credited to an affiliate through one of three paths. Each checkout gets exactly one attribution — they never stack, and an explicitaffiliate_code on the API request takes precedence.
Referral link (cookie-based)
The default path. Each affiliate gets a unique referral link (
creem.io/affiliate?code=...). A
click records attribution and redirects the visitor to your site; any extra query parameters on
the link (UTMs, deep-link params) are forwarded to your destination URL, so affiliates can
target specific landing pages and you can see their campaigns in your own analytics.Affiliate code on the Checkout API
For server-driven and headless checkouts where cookies never enter the picture. If you already
know which affiliate referred the customer, pass their referral code when creating the checkout
— no click required.
Affiliate-linked discount code
If an affiliate has a discount code assigned in the Affiliate Hub, any checkout using that code
credits them — including codes prefilled via the API.
affiliate_code value is the affiliate’s referral-link code — the same code you see in List affiliates responses and the affiliate sees in their portal. An invalid, inactive, or foreign-store code is rejected with 400 Bad Request before the checkout is created, so a typo can never silently drop attribution.
3. Commissions
Commission math follows the program’s configuration — you do not compute anything yourself:- Type and value: percentage of the sale or a fixed amount per sale.
- Recurrence:
recurringpays on every subscription payment;one_timepays only on the first payment of a subscription (the CPA model). - Duration: recurring commissions can be capped to a number of months.
- Per-product rates: individual products can override the program rate, including a
0rate to exclude a product entirely.
Current limitations
- No affiliate webhooks yet. Invitation acceptance and new conversions are not pushed as webhook events — poll List affiliate invites and List affiliate commissions where you need to react to changes.
- Program management stays in the dashboard. Creating programs and editing commission terms is done in the Affiliate Hub, not the public API.