Skip to main content
When the Yuno API returns an error, the response body always follows this structure:
{
  "code": "INVALID_PARAMETERS",
  "messages": [
    "customer.document.document_number is required for PIX payments"
  ]
}
The code field identifies the specific error class. The messages array provides one or more human-readable descriptions that detail which field or condition triggered the error. Always log both fields — the messages content is often sufficient to identify the fix without further research.
The messages array may contain multiple entries when a single request violates more than one validation rule simultaneously. Fix all reported issues before retrying.

400 Bad Request

400 errors indicate that the request was syntactically or semantically invalid. The request reached Yuno’s servers but was rejected before processing.
CodeDescriptionRecommended Fix
INVALID_REQUESTThe request body is malformed or cannot be parsed.Validate that the request body is valid JSON. Check for trailing commas, unescaped characters, or encoding issues.
INVALID_PARAMETERSOne or more fields contain invalid values or incorrect formats.Review the messages array for the specific field. Verify types, formats (e.g., ISO 4217 currency, UUID), and allowed enum values.
MISSING_PARAMETERSOne or more required fields are absent from the request body.Add the missing fields identified in messages. Consult the endpoint schema in the API reference.
INVALID_STATUSThe requested operation is not allowed for the payment’s current status.Check the payment’s current status field before issuing the action. For example, you cannot capture a payment that is already SUCCEEDED or CANCELLED.
COUNTRY_NOT_SUPPORTEDThe specified country is not supported for this payment method or account.Verify that the country field uses a valid ISO 3166-1 alpha-2 code and that the payment method is enabled for that country in the Yuno Dashboard.
CURRENCY_NOT_ALLOWEDThe specified currency is not allowed for this account or payment method.Confirm the currency uses ISO 4217 format and is enabled for your merchant account. Some payment methods enforce a specific currency (e.g., PIX requires BRL).
CUSTOMER_ID_DUPLICATEDA customer with the provided external ID already exists.Use the existing customer ID or provide a unique customer_external_id value.
INVALID_AMOUNTThe payment amount is zero, negative, or formatted incorrectly.Ensure amount.value is a positive number. Verify the number of decimal places matches the currency’s convention (e.g., 100.00 for BRL, not 10000).
INVALID_ACCOUNT_IDThe account-code header references an account that does not exist or is not accessible.Verify the account-code header value in the Yuno Dashboard under Settings > API Keys.
INVALID_TRANSACTIONThe transaction referenced in the request is invalid or cannot be found.Confirm the transaction ID is correct and belongs to a payment in the current account.
CHECKOUT_SESSION_NOT_FOUNDThe checkout session does not exist or has expired.Checkout sessions expire after 60 minutes. Create a new session via POST /v1/checkout-sessions and re-initialize the SDK with the new token.
PAYMENT_NOT_FOUNDNo payment exists with the provided payment ID.Verify the payment ID. Confirm the request is using the correct environment (sandbox vs. production) and the correct account-code.
CUSTOMER_NOT_FOUNDNo customer exists with the provided customer ID or external ID.Confirm the customer was created in the same environment and account. Customer records are not shared between sandbox and production.
IDEMPOTENCY_DUPLICATEDThe X-Idempotency-Key header value has already been used for a different request payload.Generate a new unique idempotency key (UUID v4 recommended) for each distinct payment attempt. Do not reuse keys across different requests.
PAYMENT_METHOD_NOT_FOUNDThe specified payment method is not available or not enabled.Verify the payment method is enabled for your account and country in the Yuno Dashboard under Settings > Payment Methods.
SUBSCRIPTION_NOT_FOUNDNo subscription exists with the provided subscription ID.Verify the subscription ID and confirm it was created in the same environment and account.

401 Unauthorized

401 errors indicate an authentication failure. The request did not include valid credentials or the credentials provided have expired or been invalidated.
CodeDescriptionRecommended Fix
INVALID_CREDENTIALSThe public-api-key or private-secret-key header value is incorrect.Copy the credentials directly from Dashboard > Settings > API Keys. Ensure you are using sandbox keys for https://api-sandbox.y.uno/v1 and production keys for the production base URL.
EXPIRED_CREDENTIALSThe credentials have expired or been rotated.Regenerate API keys in Dashboard > Settings > API Keys and update all services using the old credentials.
UNKNOWN_IP_ADDRESSThe request originated from an IP address not on the allowlist for your account.Add the server’s egress IP to the allowlist in Dashboard > Settings > Security, or remove the IP restriction if not required.
INVALID_TOKENThe checkout session token or one-time token provided is malformed or has been tampered with.Re-create the checkout session or re-fetch the one-time token. Ensure tokens are passed verbatim without modification.
TOKEN_IN_USEThe token has already been used for a transaction and cannot be reused.Tokens are single-use. Generate a new checkout session or one-time token for each payment attempt.

403 Forbidden

403 errors indicate the request was authenticated but the caller lacks permission to perform the action.
CodeDescriptionRecommended Fix
AUTHORIZATION_REQUIREDThe caller does not have permission to access this resource. Commonly caused by a missing or incorrect account-code header, or by using a public key for a private endpoint.Verify the account-code header is present and correct. Confirm you are using private-secret-key for server-side endpoints. The public-api-key is for client-side SDK initialization only — never for direct API calls that create or modify payments.

405 Method Not Allowed

CodeDescriptionRecommended Fix
UNSUPPORTED_METHODThe HTTP method used is not supported for this endpoint.Verify the HTTP method (GET, POST, PUT, PATCH, DELETE) against the API reference. For example, payment creation requires POST /v1/payments, not GET.

500 and 504 Server Errors

Server errors indicate a problem on Yuno’s side or a downstream timeout. These are generally transient.
CodeHTTP StatusDescriptionRecommended Fix
INTERNAL_ERROR500An unexpected error occurred on Yuno’s servers.Retry with exponential backoff. If the error persists across multiple retries, escalate to Yuno support with the full request, response, and timestamp.
REQUEST_TIMEOUT504The request timed out before Yuno received a response from a downstream provider.Implement a retry with exponential backoff. Check Yuno’s status page for active provider incidents before retrying aggressively.
For INTERNAL_ERROR and REQUEST_TIMEOUT, always use idempotency keys (X-Idempotency-Key) when retrying. Without an idempotency key, a retry may create a duplicate payment if the original request succeeded on the server before the timeout.