Error Response Format
All errors follow this structure:Error Object
HTTP Status Codes
2xx Success
4xx Client Errors
5xx Server Errors
Error Codes
Authentication Errors
Validation Errors
Resource Errors
Transaction Errors
Rate Limiting Errors
Server Errors
Handling Errors
JavaScript/Node.js
Python
PHP
Best Practices
Always Handle Errors
Always Handle Errors
Wrap all API calls in try-catch blocks and handle different error types appropriately.
Use Error Codes, Not Messages
Use Error Codes, Not Messages
Error messages may change. Always check the
code field for programmatic error handling.Log Request IDs
Log Request IDs
Include the
request_id from error responses when contacting support.Implement Retry Logic
Implement Retry Logic
For
5xx errors and rate_limit_exceeded, implement exponential backoff retry logic.Show User-Friendly Messages
Show User-Friendly Messages
Don’t expose raw error messages to users. Map errors to friendly messages.
Monitor Error Rates
Monitor Error Rates
Track error rates in your application to catch issues early.
Retry Logic
For transient errors (network issues, timeouts, server errors), implement retry logic:Error Monitoring
Integrate error tracking tools like Sentry:Getting Help
If you encounter errors you don’t understand:- Check this error reference
- Search our FAQ
- Contact support with the
request_idfrom the error response - Review Support and escalation paths
Next Steps
Rate Limits
Learn about rate limiting
Webhooks
Handle events asynchronously
Testing
Test error scenarios in sandbox
FAQ
Common questions and answers