error.code, never on message. Two rules cover most failures: a 422 created nothing, so fix it and resend under the same partner_reference; and after no answer, resend the identical request with the same reference.
Read a failure
- Every answer uses this envelope. On failure
dataandmetaarenull. error.detailsis an empty array when there is no detail and an object when there is: handle both. On an order line error it carriesindex, the zero-based line.- Log
error.codeanderror.detailson every failure. Treat an unknown code as a failure to alert a person about. - A wrong method answers
405with anAllowheader.OPTIONSanswers a bodyless204. - Another partner’s order, statement or withdrawal answers exactly like one that does not exist.
Retry or not?
Back off exponentially with jitter, for example 2 to the power of the attempt in seconds plus a random part, for up to five attempts.
Fix a refused order
Every row is safe to resend under the samepartner_reference once corrected.
Card orders can also answer
402 card_declined and 409 charge_amount_mismatch: see Create an order safely.
What to send Mart
Thepartner_reference and data.order.id if you got one, error.code with the full error.details, the time with its UTC offset, and for an order the exact body you sent. Every code is in the error catalog.