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
The category of error. See error types below.
A short string indicating the specific error. See error codes below.
A human-readable message providing details about the error.
If the error is parameter-specific, the name of the parameter related to the error. May be
null.ISO 8601 timestamp of when the error occurred.
URL to documentation about this error type.
HTTP status codes
The API uses conventional HTTP response codes to indicate success or failure:| Code | Status | Description |
|---|---|---|
| 200 | OK | Request succeeded. |
| 201 | Created | Resource was successfully created. |
| 204 | No Content | Request succeeded with no response body (e.g., DELETE). |
| 400 | Bad Request | Invalid request syntax or missing required parameters. |
| 401 | Unauthorized | No valid API token provided. |
| 403 | Forbidden | The API token lacks permissions for the requested operation. |
| 404 | Not Found | The requested resource doesn’t exist or is not accessible. |
| 422 | Unprocessable Entity | Request was valid but contained invalid parameter values. |
| 429 | Too Many Requests | Rate limit exceeded. |
| 500 | Internal Server Error | Something went wrong on the server. |
Error types
Thetype field categorizes the error:
| Type | Description |
|---|---|
invalid_request_error | The request had invalid parameters or referenced a non-existent resource. Most common error type. |
api_error | Server-side errors or temporary issues. These are rare. |
authentication_error | Invalid or missing API credentials. |
address_error | Cryptocurrency address validation failures. |
Error codes
Thecode field provides a programmatic identifier for handling specific errors:
| Code | HTTP Status | Description |
|---|---|---|
resource_not_found | 404 | The requested resource (customer, invoice, price, etc.) was not found. |
parameter_missing | 400 | A required parameter was not provided. |
parameter_invalid | 422 | A parameter value was invalid or failed validation. |
invalid_credentials | 401 | The API token is invalid or expired. |
address_invalid | 422 | The cryptocurrency address is invalid. |
rate_limit_error | 429 | Too many requests in a short period. |
verification_failed | 422 | Verification (e.g., Turnstile) failed. |
external_api_error | 502 | An external service dependency failed. |
internal_server_error | 500 | An unexpected server error occurred. |
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 thetype and code fields to handle errors programmatically:
Best practices
- Always check for the
errorobject in non-2xx responses. - Use
codefor programmatic handling, notmessage(messages may change). - Display
messageto users — it is designed to be human-readable. - Use
paramto highlight form fields that need correction. - Log
timestampand full error for debugging. - Implement exponential backoff for
rate_limit_error. - Check
doc_urlfor detailed documentation about specific errors.
Rate limiting
When you exceed rate limits, you will receive: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