Error Response Format
All errors follow a consistent format:HTTP Status Codes
- 200 OK: Successful request;
- 400 Bad Request: Invalid request parameters;
- 401 Unauthorized: API key missing or invalid;
- 403 Forbidden: API key does not have necessary permissions or IP not allowed;
- 406 Not Acceptable: Request cannot be processed (e.g., market closed);
- 429 Too Many Requests: Rate limit exceeded;
- 500 Internal Server Error: Server error.
Error Codes
Order Placement Errors
PO1
PO2
PO3
PO4
PO5
PO6
PO7
PO8
-1
Authentication Errors
401 Unauthorized
- Missing
X-Api-Keyheader - Invalid API key
- API key expired
- API key is disabled
403 Forbidden
- Your IP address is not on the API key whitelist
Rate Limiting
429 Too Many Requests
Retry-After: Number of seconds to wait before trying again
Error Handling Best Practices
- Check Status Codes: Always check HTTP status codes before processing responses
- Handle Rate Limits: Implement exponential backoff for rate limit errors
- Validate Input: Validate all parameters before sending requests
- Check Market Status: Verify that the market is open before placing orders
- Monitor Balance: Check available balance before placing orders
- Log Errors: Log error codes and messages for debugging

