Error Response Format
API errors are returned in the following format.string
Error type (
authentication_error, invalid_request_error, payment_error, api_error)string
Error code (see below)
string
Error description
string
Request ID (use when contacting support)
string
Parameter that caused the error (for validation errors)
array
Detailed error information (for validation errors)
Authentication Errors
Validation Errors
Payment Errors
Token Errors
Webhook Payment Error Codes
When a payment fails, thepayment.failed webhook includes detailed error information in a unified format that is consistent across all payment providers.
Error Structure
Error Categories
Unified Error Codes
Validation errors (API request failures — visible in 400 response, no webhook fired):
Handling Example
Error details from the original payment provider (PSP-specific codes) are not exposed in API responses or webhooks. Use the unified
code and category fields to determine the appropriate action.Refund Errors
Resource Errors
Idempotency Errors
System Errors
Error Handling Best Practices
1
Check HTTP Status Code
4xx: Client error (request needs modification)5xx: Server error (retriable)
2
Branch Logic by Error Code
Use
error.code to implement error-type-specific handling3
Retry Strategy
For
5xx errors or idempotency_key_in_use, retry with exponential backoffSample Code
Node.js