Response Code Overview
The API uses standard HTTP status codes to indicate the result of each request. Understanding these codes is essential for proper error handling and user experience.Success Codes
200 OK
Meaning: Request completed successfully. When it occurs:- Successful withdrawal creation
- Successful status retrieval
- Successful withdrawal updates
Client Error Codes (4xx)
400 Bad Request
Meaning: Invalid request parameters or data. When it occurs:- Missing required parameters
- Invalid parameter values
- Invalid data format
- Validation errors
- Review the error message
- Correct the invalid parameters
- Resubmit the request with valid data
401 Unauthorized
Meaning: Missing or invalid authentication token. When it occurs:- Missing
Authorizationheader - Invalid API token
- Expired or revoked token
- Token format incorrect
- Verify the
Authorizationheader is present - Check that the token format is correct:
Token YOUR_API_KEY - Verify you’re using the correct API key for the environment
- Contact support if the token should be valid
404 Not Found
Meaning: Withdrawal ID not found. When it occurs:- Querying a withdrawal that doesn’t exist
- Invalid withdrawal ID format
- Withdrawal belongs to a different business
- Verify the withdrawal ID is correct
- Check that you’re querying the correct environment
- Ensure the withdrawal belongs to your business
Server Error Codes (5xx)
500 Internal Server Error
Meaning: Server-side error occurred. When it occurs:- Unexpected server errors
- Temporary system issues
- Database or service unavailability
- Retry the request after a short delay
- If the error persists, check system status
- Contact support with the error ID if provided
- Implement exponential backoff for retries
Error Response Structure
All error responses follow a consistent structure:Handling Errors
Best Practices
- Always check status codes: Don’t assume success based on response body alone
- Parse error messages: Extract and display user-friendly error messages
- Log errors: Log all errors with full context for debugging
- Implement retries: Retry transient errors (5xx) with exponential backoff
- Handle 4xx errors: Don’t retry client errors (4xx) without fixing the issue
- User feedback: Provide clear feedback to users about what went wrong
Retry Logic
Do retry:500 Internal Server Error(with exponential backoff)- Network timeouts
- Connection errors
400 Bad Request(fix the request first)401 Unauthorized(fix authentication first)404 Not Found(verify the resource exists)
Example Error Handling
Status Code Summary
| Code | Meaning | Retry? | Action |
|---|---|---|---|
200 | Success | No | Process response |
400 | Bad Request | No | Fix request and resubmit |
401 | Unauthorized | No | Fix authentication |
404 | Not Found | No | Verify resource exists |
500 | Internal Server Error | Yes | Retry with backoff |
Next Steps
- Review status codes reference for withdrawal statuses
- Learn about creating withdrawals to see responses in context
- Check testing requirements to test error scenarios

