Utopia PaymentsDocs

Errors

HTTP statuses, machine-readable error codes and safe retry behaviour.

Failed requests return an HTTP status and a JSON body with a stable code and a human-readable message.

HTTP/1.1 400 Bad Request

{
  "code": "CURRENCY_NOT_SUPPORTED",
  "message": "USD is not enabled for payments. Enabled: AED"
}

Codes raised by the API

StatusCodeMeaning
400INVALID_REQUESTA body, query parameter or field combination is invalid.
400INVALID_REQUEST_BODYA webhook URL is malformed, non-HTTPS, private or otherwise unsafe.
400INVALID_CURSORThe pagination cursor is malformed or no longer usable.
400INVALID_IDEMPOTENCY_KEYThe key is not 1–255 printable ASCII characters.
400PRODUCT_NOT_ACTIVEA checkout contains a draft or archived product.
400INVALID_PRICEA price is zero, or a three-decimal currency checkout uses its third decimal place.
400INVALID_CARTA recurring checkout does not contain exactly one recurring product.
400MIXED_CURRENCIESProducts in one checkout use different currencies.
400CURRENCY_NOT_SUPPORTEDThe currency is not enabled for this account and mode.
401UNAUTHORIZEDThe API key is missing, wrong or revoked.
403MERCHANT_NOT_APPROVEDThe account is not approved to use the API.
403FORBIDDENThe authenticated key cannot perform the operation.
404NOT_FOUNDThe endpoint or object does not exist for this merchant and mode.
405METHOD_NOT_ALLOWEDThe path exists but not for that HTTP method.
409CUSTOMER_EXISTSA customer with this email already exists in this merchant and mode.
409IDEMPOTENCY_KEY_IN_USEAnother request with the same key is still running; retry the same request.
409TEST_MODE_UNAVAILABLESandbox payments are not enabled for the account.
409SUBSCRIPTION_CANCELLEDA cancelled subscription cannot be changed.
409CANCELLATION_FINALRenewal was already stopped at the processor and cannot be resumed.
409CONFLICTThe request conflicts with the object's current state.
410GONEThe resource existed but can no longer be used.
413PAYLOAD_TOO_LARGEThe request exceeds the body-size limit.
415UNSUPPORTED_MEDIA_TYPEThe request content type is unsupported.
422IDEMPOTENCY_KEY_REUSEDThe key was previously used with different request parameters.
422UNPROCESSABLE_ENTITYThe request is syntactically valid but cannot be processed.
429RATE_LIMITEDThe rate limit was reached; follow Retry-After.
503PAYMENTS_UNAVAILABLELive payment configuration is temporarily unavailable.
5xxINTERNAL_ERRORAn unexpected server error occurred.
409LIMIT_REACHEDThe account reached a resource limit, such as API keys or webhooks.

Validation errors produced from a schema use INVALID_REQUEST. The message names the first invalid field, but integrations should branch on code, not the English message.

Retrying

Retry network errors, 429, IDEMPOTENCY_KEY_IN_USE and 5xx with backoff. For a POST, reuse the same Idempotency-Key and identical body. Do not retry other 4xx responses without changing the request or account state.

The libraries map statuses to typed errors. See Node.js and PHP.

On this page