2xx status code. When it doesn’t, you get a 4xx or 5xx code and an error object that explains what went wrong.
The error object
Some errors add extra fields to help you, such as
requested_version and supported_versions on version errors.
Idempotency errors are the one exception: they only have
code and message.How to handle errors
1
Check the status code
4xx means something about the request needs to change. 5xx means a problem on our side or with a partner, and trying again later may work. See Status codes.2
Check the code
Handle the codes you expect, such as
quote_expired. See Error codes.3
Show or log the message
If it’s a field problem, read
errors to see exactly which fields to fix.4
Log the request ID
Always log
request_id. Support can find your request with it.
