Error response format
HTTP status codes
Common error codes
Authentication errors
Payment errors
Resource errors
Webhook errors
Handling errors
Best practices
- Check the
successfield first - Use the
error.codefor programmatic handling - Display
error.messageto users (it’s human-readable) - Implement retry logic for 5xx errors
- Log all errors for debugging