Skip to main content
The API lets your own server tell Affiliate Manager about a sale, a lead or a refund. It is JSON over HTTPS, authenticated with a bearer token.
Call the API from your server, never from a visitor’s browser. The token is a secret: anyone who has it can record referrals.

Authentication

Find your token under Integrations → API token. Send it on every request:
Until a token exists the API is off and every call returns 401. Requests are limited to 120 per minute. Base address: https://YOUR-INSTALL/api/v1

Record a sale or a lead

POST /referrals Credits a sale or a lead to an affiliate. Identify the affiliate by their code (ref) or by a coupon code.

Example

Response

201 Created for a new referral, 200 OK when the external_id was already recorded:
commission is null when nothing is earned (for example a lead that has not been marked won yet, or a purchase by the affiliate themselves).

Errors

Refund a sale

POST /referrals/refund Tell Affiliate Manager that a sale was refunded. A commission that has not been paid yet is reversed.
It returns the same shape as above with the new status, or 404 if no referral has that external_id.

Credit visitors from your website

To carry an affiliate’s ?ref= code from the link to your contact form, add https://YOUR-INSTALL/track.js to your pages. It stores the code in a cookie and fills any form field named affiliate_ref. Send that value as ref when you report the lead. See Connecting sales and leads.