retry-after header on a 429 response.
What a limit counts
Each rate-limited endpoint counts your requests in a bucket. A bucket holds one count for one merchant on one endpoint. When the count goes above the limit, the API rejects the request with429 Too Many Requests until the window resets.
Two rules follow from this:
- The allowance belongs to the merchant, not to the API key. If you create a second API key, your allowance stays the same. It also does not matter which of your keys a request uses.
- Each endpoint has its own bucket. Requests to one endpoint do not spend the allowance of another endpoint.
POST /v0/subscriptions/{id}/reconciliationsPOST /v0/subscriptions/{id}/portal
The limits
A published limit can go up later. It does not go down.
Response headers
An authenticated request to an endpoint in the table above returns three headers. They give the count of your bucket. A request that fails authentication returns none of them, because the API refuses the request before it counts it.
A
429 response adds one more header:
Endpoints outside the table can also return the three
x-ratelimit-* headers. Their values do not describe a limit that you can reach. Read these headers only for the endpoints in the table.
The body of a 429 response has this shape. The message text is specific to the endpoint:
How to retry
Do not retry a429 immediately. An immediate retry makes the burst larger.
- Read the
retry-afterheader. Wait that number of seconds. - If the header is absent, wait one second. Then double the wait for each further rejection.
- Stop after five attempts. Then report the failure.
x-ratelimit-remaining. Send fewer requests before it reaches 0. For bulk work, send the requests in sequence, not at the same time.
Related pages
- Authentication — How to send your API key
- API Keys — How to create and revoke keys
- Reconciling subscription features — The reconciliation endpoint and its limit