Skip to main content

Error Codes

All errors return a consistent JSON structure with a machine-readable code field for programmatic handling and a human-readable message field for debugging.

Error Types

Payment Intent Errors

Authentication Errors

Webhook Errors

Rate Limit Errors

Handling Errors

Best Practices

  • Always check error.code for programmatic handling, not error.message (messages may change).
  • Retry on 429 and 500 with exponential backoff. Use the X-RateLimit-Reset header for rate limits.
  • Never retry on 400, 401, 403, 404 — these indicate issues with your request, not transient failures.
  • Log the full error response for debugging. Include the error.type, error.code, and error.param fields.