Skip to main content
All error responses follow a consistent format.

Error Response Format

HTTP Status Codes

Errors any endpoint can return

Each endpoint page in the API reference lists the errors specific to that endpoint. The errors below can come from any endpoint, so they are documented only here.

Validation errors

A request that does not match the endpoint’s schema returns 422 with code VALIDATION_FAILED. The detail object says what failed:
  • on names the part of the request that failed: body, query, params or headers.
  • errors lists each problem. Every entry has a path to the field and a message. Most entries also carry a code for the rule that failed.
For example, sending cardType instead of type to POST /cards returns:
The API ignores fields it does not recognize. A misspelled field therefore shows up as an error on the required field it was meant to fill. Nested fields use dot-separated paths, such as config.maxAmount. A few checks run after schema validation, such as decoding a pagination cursor. These also return VALIDATION_FAILED, with a shorter detail in place of errors.

Handling Errors

Use the code field for programmatic error handling. Branch on code rather than the HTTP status, because several errors can share a status. For example, a few endpoints use 422 for their own business-rule errors alongside VALIDATION_FAILED.

Retries

For 5xx errors, retry with exponential backoff. For 429, wait for the Retry-After header. For other 4xx errors, fix the request before retrying.