Skip to main content

HTTP status codes

Check the HTTP status first. Anything other than 200 OK (or 201 Created on v5 token creation) indicates an error; the body carries the detail.

Error body — payments (charges, tokens, refunds, webhooks)

error.param is usually the HTTP status as a string; occasionally a status name such as "BadRequest". A declined charge (402) returns the normal charge envelope rather than this object.

Error body — Billing

Send Accept: application/json on every Billing request; without it, errors come back as HTML.
status is false, code matches the HTTP status, messages has one item per problem (message_field on validation errors), and message is Unauthorized, Forbidden, Not Found, The given data was invalid. or the specific message for other errors.

Gateway error codes

Returned in error_code on charges, refunds and pre-authorisations, and in webhook payloads.