Errors
An error can occur in two places: before the call reaches Oscar (authentication, API key, call limits) or while Oscar processes the call. The two have different structures.
Errors from Oscar processing (v2)
v2 returns errors in RFC 9457 format, with Content-Type: application/problem+json:
{
"title": "Bad Request",
"status": 400,
"detail": "Unsupported operator: equals"
}
status– the HTTP status code.title– a short description of the error type.detail– a more detailed explanation. The text is meant for people: base your integration logic on the status code, not on this text.
The response can also contain the fields type and instance.
Errors before Oscar
For authentication, API key and call limit errors, the body has the form:
{ "message": "Unauthorized" }
Status codes
400 Bad Request– the request is invalid: a missing or malformed field, or an unknown search operator. Fix the request; do not retry it as is.401 Unauthorized– the access token is missing, expired or does not authorize the call. Get a new token, see Authentication.403 Forbidden–x-api-keyis missing or does not match, or the key has no access to the called API.404 Not Found– the path or the row does not exist.429 Too Many Requests– the call limit was exceeded. Retry later, see Limits.500 Internal Server Error– an unexpected error in Oscar.502 Bad Gateway– the response could not be delivered, for example because it exceeded the size limit.504 Gateway Timeout– processing took longer than the time limit.
Retrying
- Retry after
429,502,503and504responses. Increase the wait time on each attempt (for example 1 s, 2 s, 4 s) and limit the number of attempts. - Do not retry after
400,401,403or404responses until you have fixed the cause. After a401, get a new token first. - Do not blindly repeat write calls after a timeout. The change may have been saved even though the response did not arrive. Check with a search call first whether the change was saved.
Reporting an error to support
The x-amzn-RequestId header of every response identifies the call. Include it in your support request together with the time, path and status code of the call, so the call can be found in the logs directly.
You can file a support request on the Support page.
