Skip to main content
All API errors are returned in a consistent JSON format with an error object containing structured information about what went wrong. The error format follows Stripe’s API error conventions for consistency and familiarity.

Error response structure

Response format

Error attributes

string
required
The category of error. See error types below.
string
required
A short string indicating the specific error. See error codes below.
string
required
A human-readable message providing details about the error.
string
If the error is parameter-specific, the name of the parameter related to the error. May be null.
string
required
ISO 8601 timestamp of when the error occurred.
string
required
URL to documentation about this error type.

HTTP status codes

The API uses conventional HTTP response codes to indicate success or failure:

Error types

The type field categorizes the error:

Error codes

The code field provides a programmatic identifier for handling specific errors:

Common error examples

Resource not found (404)

When requesting a resource that doesn’t exist or belongs to another account:
Response

Validation error (422)

When creating or updating a resource with invalid data:
Response

Nested resource not found (404)

When a nested resource reference is invalid:
Response

Authentication error (401)

When the API token is missing or invalid:
Response

Handling errors

Programmatic error handling

Use the type and code fields to handle errors programmatically:

Best practices

Use the code field for programmatic handling, not the message field. Messages may change over time while codes remain stable.
  1. Always check for the error object in non-2xx responses.
  2. Use code for programmatic handling, not message (messages may change).
  3. Display message to users — it is designed to be human-readable.
  4. Use param to highlight form fields that need correction.
  5. Log timestamp and full error for debugging.
  6. Implement exponential backoff for rate_limit_error.
  7. Check doc_url for detailed documentation about specific errors.

Rate limiting

When you exceed rate limits, you will receive:
Implement exponential backoff when retrying rate-limited requests. Do not retry immediately or in a tight loop.

Support

For questions about API errors or unexpected error responses, contact support with:
  • The full error response JSON
  • The request that caused the error (excluding sensitive data)
  • The timestamp of the error