Skip to main content

A failed payment is not an HTTP error

This is the distinction that matters most. If a customer’s payment is declined, the request still succeeds: you get a 2xx, and the failure is described inside the resource, on the attempt’s failure block. An HTTP error means Orchestrate could not process your request — bad credentials, invalid input, a resource that does not exist. Handle the two separately.

Failure categories

Every payment failure carries a category. Branch on the category, not on the individual code: codes are added over time, categories are stable.

HTTP status codes

Error shape

Errors carry a human-readable message. Validation errors add a field-by-field breakdown.
Show message to your operators, not to your customers — for customers, use the failure.code.message on the attempt, which is written for them.

Retrying safely

429 and 5xx are worth retrying with exponential backoff. Always send an idempotency key on the original request so the retry cannot create a second payment. 4xx other than 429 will not succeed on retry. Fix the request first.