Always check the HTTP status code first. Then use the error
code field for programmatic handling.Error response format
Common HTTP status codes
Common error codes
Validation error example
How to handle errors
1
Check the status code
Use the HTTP status code to decide whether the request failed because of authentication, validation, permission, or server issues.
2
Read the error code
Use the
code field for app logic and retry decisions.3
Show a helpful message
Use the
message field to display a friendly explanation to the user.4
Retry safely
Retry only safe requests or requests that include an
Idempotency-Key.Best practices
- Log the status code, error code, and request reference when a request fails.
- Do not expose raw server messages to end users without context.
- Retry only when the request is safe to repeat.
- Use idempotency for create and payout requests.
- Contact support if you repeatedly receive
server_errorresponses.