Error Codes
HTTP status codes and error response format.
Error Response Format
Errors return a plain-text message body with the appropriate HTTP status code:
HTTP/1.1 401 Unauthorized
Invalid token
Some endpoints return JSON errors:
{
"error": "Insufficient balance"
}
Status Codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created (new user, new order) |
| 400 | Bad Request — invalid parameters |
| 401 | Unauthorized — missing or expired token/API key |
| 403 | Forbidden — not your resource (e.g. canceling another user's order) |
| 404 | Not Found — asset or resource doesn't exist |
| 429 | Too Many Requests — rate limit exceeded (5 req/s) |
| 500 | Internal Server Error — unexpected failure |
Common Error Messages
"Invalid token"— JWT expired or malformed. Refresh your token via/auth/refresh."Insufficient balance"— Not enough OPS for the order."Username already exists"— Registration conflict."Order not found"— Invalid order ID for cancel."Not your order"— Attempting to cancel another user's order."Asset not found"— Invalid asset ID.