Errors and rate limits
A failed call answers with an HTTP error status and a JSON body that names the problem in words you can show a developer.
Error response
{
"code": "permission_denied",
"message": "this access token needs the orders.write scope"
}Codes
| Code | HTTP | Meaning | Retry? |
|---|---|---|---|
invalid_argument | 400 | A field is missing or wrong; the message says which. | No, fix the request |
failed_precondition | 400 | The record isn't in a state that allows this, such as refunding a voided order. | No |
unauthenticated | 401 | No token, or it is wrong, revoked or expired. Refresh an expired access token. | After refreshing |
permission_denied | 403 | The key's role or the token's scopes don't allow this. | No |
not_found | 404 | No such record in this business. | No |
already_exists | 409 | A record with this ID or unique value exists. | No |
aborted | 409 | A conflicting change happened at the same time. | Yes, read again first |
resource_exhausted | 429 | Rate limited. The Retry-After header says how many seconds to wait. | Yes, after waiting |
internal | 500 | Something broke on our side. | Reads, with backoff |
unavailable | 503 | Briefly unavailable. | Reads, with backoff |
Rate limits
- API keys: 600 requests a minute per key.
- Apps: 600 requests a minute per app for each connected business, so one busy business never slows your app for the others.
- OAuth token endpoint: 60 requests a minute per client ID.
Over the limit, calls fail with resource_exhausted and Retry-After. The SDKs wait and retry reads for you. For bulk work, prefer list methods with a large page size, the Export methods, or webhooks instead of polling.