Skip to main content

Overview

The Payment Links and Payment Intents endpoints use the same nested error envelope. Always branch on error.code, not on the wording of error.message, which can change between releases. For cross-cutting handling (HTTP status ranges, retry and reconciliation rules), see Errors. The Payment Links API returns a nested envelope:
Application errors include correlation_id (also returned as the x-correlation-id response header). Platform-generated authentication, authorization, and rate-limit errors use the same shape but do not include correlation_id.
Design note - why cross-tenant reads return 404, not 403. Requesting a link that belongs to another entity returns 404 NOT_FOUND, the same as an id that does not exist. A 403 would confirm the link exists, leaking information across tenants. Returning 404 gives no such existence oracle.

Hosted checkout and JavaScript SDK errors

Errors returned to the hosted checkout page and the JavaScript SDK use the same nested error object, with details.field naming the rejected input (for example bill_to.postal_code or card.number). For compatibility, these responses also repeat code, message, request_id, and details at the top level; read error. If you use the JavaScript SDK you do not parse these bodies yourself: branch on result.error.type (see Confirm payment). Customer and billing fields are limited to the lengths the card processor accepts, counted in characters: Postal codes must also match the country’s format when the billing country is one of these. A mismatch returns 400 with details.field bill_to.postal_code and details.rule postal_code_format. Other countries have only the length check. Postal code is optional.

Payment Intents errors

The Payment Intents API uses the same nested envelope as Payment Links. Validation errors can include an optional details object with machine-readable context. Use details.field to identify the request field; the human-readable message does not repeat it as a prefix.

Next Steps

Payment Links

Create and manage hosted checkout links

JavaScript SDK

Take card payments in the browser

Global errors

HTTP status ranges and retry rules

Testing

Test cards and error scenarios