Skip to main content
The YuvexPay API uses standard HTTP status codes and returns structured error responses.

Error response format

All errors follow a consistent structure:
Most errors use the nested envelope above. A few low-level guards return a flat envelope instead — notably the idempotency middleware (IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_PAYLOAD_MISMATCH, IDEMPOTENCY_CONFLICT):
In the flat shape, error is a string (the HTTP reason phrase), not an object, and the machine-readable code lives in the top-level code field. To handle both shapes, read the code defensively: body.error?.code ?? body.code.

HTTP status codes

Error codes

Authentication errors

Validation errors

Idempotency errors

Rate limiting errors

Resource errors

Payment errors

Refund errors

Withdrawal errors

Server errors

Handling errors