Rate limits
Rate limits are applied per client (your client id), per minute. They protect the API, and the address and quote endpoints in particular, which call Google.
Limits
Each group of requests has its own limit, counted separately.
| Requests | Business | Platform |
|---|---|---|
POST /quotes | 30 a minute | 300 a minute |
POST /addresses | 30 a minute | 300 a minute |
Any GET | 600 a minute | 600 a minute |
Other writes (POST /deliveries, book, ready, cancel, confirm, PATCH, DELETE) | 120 a minute | 120 a minute |
POST /wallet/fund | 10 a minute | 10 a minute |
POST /webhooks/test | 10 a minute | 10 a minute |
Sandbox endpoints (/sandbox/...) | 60 a minute | 60 a minute |
The token endpoint, POST /oauth/token, allows 60 requests a minute per client. Cache your access token (it lasts an hour) instead of fetching one per request.
If your volume needs more, email support@getreeds.co with your client id and the volume you expect.
Test mode and Live mode have their own credentials, so each has its own count.
Headers
Responses carry your current standing:
| Header | Description |
|---|---|
X-RateLimit-Limit | Requests allowed in the current window, for this request's group |
X-RateLimit-Remaining | Requests left in the current window |
X-RateLimit-Reset | Unix time (seconds) when the window resets |
When you go over
Over the limit, the API returns 429 with the code RATE_LIMITED and a Retry-After header, the number of seconds to wait.
HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 0
{
"status": "failed",
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests",
"doc_url": "https://developer.getreeds.co/errors/RATE_LIMITED"
}
}
A 429 releases the idempotency key, so wait and retry with the same key.
RATE_LIMITED also covers the account's daily allowance for address lookups and pricing (saving, updating and confirming addresses, fresh quotes, and creating deliveries all ask Google). Once it is used up, those requests get 429 RATE_LIMITED with a message that says so, and Retry-After counts down to midnight, Lagos time. Reused quotes and saved addresses don't count. Email support@getreeds.co if your account needs more.
When Reeds is busy
When Reeds is overloaded it sheds load rather than keep you waiting: any request, the token endpoint included, can get 503 with a Retry-After header, and nothing was done. The API answers SERVICE_UNAVAILABLE in the usual failure envelope; POST /oauth/token answers { "error": "temporarily_unavailable" }. Wait the Retry-After seconds, then send the same request again, with the same idempotency key.
Backoff advice
- Wait for
Retry-Afterwhen it is present, on a429or a503. Otherwise wait 1, 2, 4, 8 seconds, with a little random jitter, and give up after a few tries. - Slow down before you hit the limit: watch
X-RateLimit-Remaining. - Quote once per checkout, not on every keystroke or page view. A quote lasts 24 hours.
- Save addresses once with
POST /addressesand reuse the ids. - Listen to webhooks instead of polling deliveries.