Errors and Rate Limits
Error format
json
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key is missing, invalid, revoked or expired.",
"param": null,
"request_id": "req_..."
}
}| Field | Type | Description |
|---|---|---|
type | string | Error type |
code | string | Error code. See Error codes |
message | string | Description in English |
param | string or null | The parameter that caused the error. Can have a value only for parameter_invalid |
request_id | string | The ID of this request, the same as the X-Request-Id response header |
Error codes
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request | parameter_invalid | A query parameter is not accepted or its value is invalid. See Pagination and Filtering |
| 401 | authentication_error | invalid_api_key | No key was sent, or the key is invalid, revoked, or expired |
| 401 | authentication_error | api_key_exposed | The key appeared in the URL, or in a header other than Authorization, Cookie, or Proxy-Authorization, and has been revoked |
| 403 | permission_error | insufficient_permission | The key lacks the permission the endpoint requires |
| 403 | permission_error | merchant_inactive | The merchant account is deactivated |
| 403 | permission_error | ip_not_allowed | The request's source address isn't one of the key's allowed source addresses |
| 404 | invalid_request | resource_missing | The path does not exist, or the resource does not exist or does not belong to this merchant |
| 405 | invalid_request | method_not_allowed | The path does not accept this HTTP method |
| 429 | rate_limit_error | rate_limited | The rate limit was exceeded |
| 500 | api_error | internal_error | Server error |
| 503 | api_error | service_unavailable | The service is temporarily unavailable. Retry later |
401 responses include a WWW-Authenticate: Bearer header.
Request ID
Responses include an X-Request-Id header: req_ followed by 24 alphanumeric characters. The request_id in an error response has the same value.
Rate limits
- Each key is counted separately. Requests with no key, an invalid key, or a source address that isn't one of the key's allowed source addresses are counted by source IP.
- Responses include
X-RateLimit-Limit(the limit),X-RateLimit-Remaining(requests left), andX-RateLimit-Reset(when the limit resets, in UTC epoch seconds). - When the limit is exceeded, the request returns 429
rate_limitedwith aRetry-Afterheader (in seconds). Wait that many seconds, then retry.