Errors
Every error has the same shape, and its retry action tells you what to do next.
When a request fails, the body tells you what went wrong, which fields caused it, and what to do about it. Branch your code on error.code and error.retry_action.type. The message is written for a person.
The error envelope
Every answer, success or error, carries its ID in a Request-Id header, and an error body repeats it as request_id.
Error codes
Only the purchase operations return quote_expired, price_changed, and purchase_not_supported. The API doesn’t have those operations yet.