Skip to main content
OwnPay uses standard HTTP status codes and a consistent JSON error envelope so you can handle failures programmatically. Every non-2xx response returns a machine-readable error.code and a human-readable error.message.

Error response structure

All error responses share the same shape:

HTTP status codes

Common error codes

Authentication

See Authentication for how to pass credentials.

Validation

Resource errors

Gateway errors

Rate limits

Validation error details

Validation failures include a details object mapping each field to its error messages:

Handling errors

1

Check the HTTP status

Use the status code to decide whether to retry, surface the error to the user, or log it silently.
2

Branch on `error.code`

Never parse error.message. Codes are stable across releases; messages are not.
3

Retry safely

Retry on 429, 500, 502, and 503 with exponential backoff. Always send an Idempotency-Key on retries.
4

Log the full envelope

Persist error.code, error.message, and error.details alongside the request ID for debugging.
Include an Idempotency-Key header on every mutating request. It lets you retry safely without creating duplicate payments or refunds.
Last modified on August 25, 2026