Error Response Format
All API errors follow a consistent JSON format:HTTP Status Codes
The Wallbit API uses standard HTTP status codes to indicate the success or failure of requests.Success Codes
| Code | Description |
|---|---|
200 OK | Request succeeded |
201 Created | Resource created successfully |
204 No Content | Request succeeded, no content to return |
Client Error Codes
| Code | Description |
|---|---|
400 Bad Request | Invalid request parameters |
401 Unauthorized | Missing or invalid API key |
403 Forbidden | API key lacks required permissions |
404 Not Found | Resource doesn’t exist |
422 Unprocessable Entity | Request is valid but cannot be processed |
429 Too Many Requests | Rate limit exceeded |
Server Error Codes
| Code | Description |
|---|---|
500 Internal Server Error | Something went wrong on our end |
502 Bad Gateway | Upstream service error |
503 Service Unavailable | API is temporarily unavailable |
Common Errors
Authentication Errors
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
Validation Errors
400 Bad Request
400 Bad Request
details field for specific validation issues and correct your request.Business Logic Errors
422 Unprocessable Entity
422 Unprocessable Entity
Error Handling Best Practices
Always Check Status Codes
Always Check Status Codes
Don’t assume requests succeed. Always check the HTTP status code before processing the response:
Log Error Details
Log Error Details
Log the full error response for debugging:
User-Friendly Messages
User-Friendly Messages
Don’t show raw API errors to users. Map error codes to friendly messages:
Error Code Reference
| Code | Description |
|---|---|
INVALID_API_KEY | API key is missing or invalid |
INSUFFICIENT_PERMISSIONS | API key lacks required permissions |
VALIDATION_ERROR | Request parameters are invalid |
INSUFFICIENT_BALANCE | Not enough funds for the operation |
ASSET_NOT_FOUND | Requested asset doesn’t exist |
TRADE_FAILED | Trade could not be executed |
RATE_LIMIT_EXCEEDED | Too many requests |
INTERNAL_ERROR | Server-side error |

