X-Api-Key header, see Authentication. Also send Accept: application/json, so errors come back as JSON too.
Versions
This reference describes version 1.6. The version is part of the path of every request. Server-to-server postbacks use the/1.7/pb/ endpoints.
Pagination
Endpoints that return lists are paginated, 25 items per page. Ask for further pages with thepage parameter; numbering starts at 1.
Link header:
To read a whole list, follow
rel="next" until it is absent. A walk through all pages can miss an object or return it twice when the list has no unique order. This is known for two lists: List all commissions returns commissions in no guaranteed order, and List all affiliates orders affiliates by creation time to the second, so it happens with affiliates created in the same second.
Rate limits
Limits apply per API key and per endpoint, in a fixed window that starts with your first request.
Responses of limited endpoints carry these headers:
Over the limit, the API answers
429 Too Many Requests with a plain-text body and no Retry-After header. Wait until X-RateLimit-Reset, then continue.
The path /1.6/clicks/ has one more limit, counted per IP address instead of per API key: 900 requests per 5 minutes, Create a click and List all clicks together. Requests for a single click, /1.6/clicks/{id}/, aren’t counted. It is checked before a request reaches the API, so from one IP address you reach it before the 900 per minute in the table. Over this limit, requests to the path get 403 Forbidden with an HTML page, not 429, and without the headers above. A click blocked this way isn’t recorded. If you send clicks in bulk from one server, spread them out.
Other endpoints, such as creating conversions and customers, have no fixed limit today. Handle 429 everywhere anyway, so your integration keeps working if limits change.
Errors
The API uses standard HTTP status codes and returns a JSON body explaining the error. Errors lists the formats and the messages integrations run into most often.Conventions
- Timestamps are ISO 8601 with a UTC offset, for example
2021-03-03T12:39:19+00:00. - Properties without a value are returned as
null, not omitted. One exception:fraudis returned only by Retrieve an affiliate, and only for affiliates who signed up with your account. - IDs of affiliates and programs are strings, for example
janejamesonorjohns-affiliate-program.