Skip to main content
Every Yuno API error returns the same compact JSON envelope. Parse the code for programmatic handling and surface the messages array to your support tools.

Error envelope

There is no error wrapper, no singular message, no type, no details. The body is exactly the two top level fields above.
Yuno sets x-trace-id on every response. When you open a support ticket, attach the response body and the x-trace-id header so the team can pull the trace.

HTTP status to error code

The shared utility libraries map common HTTP statuses to a default code. Service code may return a more specific business code for the same status (see the next table).
Yuno does not currently use HTTP 422. Schema and constraint failures arrive as 400 with code VALIDATION_ERROR (Kotlin services) or BAD_REQUEST (Go services). Most “not found” business cases (such as CUSTOMER_NOT_FOUND, RECIPIENT_NOT_FOUND) also arrive as 400 with a descriptive code, not as 404.

Resource specific business codes

Services emit their own code values for domain rules. The most common ones you will see in production:

Customers

Recipients (marketplace)

Validation framework codes (Kotlin services)

These come from the shared exception handler in the Kotlin services and apply to checkout sessions, recipients, payouts, and any service that uses the shared library.

Provider errors

Errors that originate at a downstream payment provider are surfaced under codes prefixed with PROVIDER_. Examples include PROVIDER_INVALID_CREDENTIALS, PROVIDER_INVALID_REQUEST, PROVIDER_PAYMENT_NOT_FOUND, PROVIDER_INVALID_AMOUNT, PROVIDER_COUNTRY_NOT_SUPPORTED, and PROVIDER_CURRENCY_NOT_ALLOWED. The provider’s raw response is reflected through messages. See Provider errors for the full mapping.

Validation errors in practice

Validation failures from Kotlin services package every failed field into the messages array. The shape is always { code, messages }, never a structured details object.
When you display these to internal users (operators, support), surface every entry in messages so they can act on all failures at once.

Retry strategy

For non idempotent writes, the safe pattern is to set a unique business key in the request body (merchant_customer_id, merchant_order_id, merchant_recipient_id). Yuno’s database constraints reject duplicates, so a retry that finds the same key returns a clear 400 rather than creating a duplicate. The one endpoint that supports X-Idempotency-Key directly is POST /v1/subscriptions. See Avoiding duplicates.
Retry transient failures only. Do not retry codes that mean “your request is wrong”. Automated retries on those waste budget and add noise. Use exponential backoff with full jitter, starting at 1 s and capped at 30 s. When Retry-After is present on a 429, honor it as the floor for the wait.

Best practices

  1. Branch on code, never on messages. The strings in messages are subject to copy edits and localization. The code is the contract.
  2. Set a unique business key on every non idempotent write (merchant_customer_id, merchant_order_id, merchant_recipient_id). On POST /v1/subscriptions you can also pass X-Idempotency-Key.
  3. Log the full envelope plus the x-trace-id response header for every failed request. Without x-trace-id, support cannot find your request in our traces.
  4. Treat PROVIDER_* codes as upstream signals. They indicate the failure happened at the provider, not at Yuno. Inspect messages for the provider’s raw text.
  5. Alert on 5xx rate, not on individual 5xx events. Provider blips are normal. Sustained spikes are not.

What next

Avoiding duplicates

Use unique business keys to make retries safe across customers, payments, and subscriptions.

Error codes catalog

Full reference of every error code Yuno can return.

Provider errors

PROVIDER_* codes mapped to each provider’s raw responses.