Skip to main content
Branch on 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 data and meta are null.
  • error.details is an empty array when there is no detail and an object when there is: handle both. On an order line error it carries index, the zero-based line.
  • Log error.code and error.details on every failure. Treat an unknown code as a failure to alert a person about.
  • A wrong method answers 405 with an Allow header. OPTIONS answers a bodyless 204.
  • 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 same partner_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

The partner_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.