REST API
Authentication
Every request to a public endpoint is guarded. Authentication combines two factors:
- an API key passed as the
apiKeyquery parameter, and - the calling domain, derived from the request's
Refererheader (falling back to theHostheader).
The pair (domain, apiKey) is checked against an allow-list. A key only works
from the domain(s) it was issued for.
Why a domain too?
Because the key travels in the URL of browser requests, binding it to a domain limits the damage if it leaks: it cannot be reused from another origin.
Sending credentials
| Field | Where | Required | Description |
|---|---|---|---|
apiKey | query | yes | Your API key. |
Referer | header | yes | The host portion is matched against the allow-list. Browsers set this automatically; set it explicitly for server-side calls. |
The host is normalised before matching: the port is stripped and a leading
www. is removed. So https://www.yourapp.com:443/checkout is matched as
yourapp.com.
Examples
cURL
Code(bash)
JavaScript
Code(js)
Python
Code(python)
Failure
If the key or domain is missing or not allow-listed, the API responds with
403 Forbidden:
Code(json)
A missing key or domain returns 403 with "Missing API key or domain". See
Errors for the full list.
Last modified on
