Errors that help you recover.
Every API failure uses one predictable envelope and carries a request ID that can be traced without exposing your credential.
Error shape
json400 response
{
"error": {
"code": "invalid_currency",
"message": "currency must contain up to 25 comma-separated asset codes.",
"requestId": "req_01J6EXDZ...",
"docsUrl": "https://api.exchangedz.com/docs/errors#invalid_currency"
}
} Status codes
Safe retries
All documented v1 data endpoints use GET and can be retried safely. Retry only transient responses, cap the attempt count and add jitter so clients do not synchronize.
javascriptBounded exponential backoff
async function requestWithBackoff(url, options, attempt = 0) {
const response = await fetch(url, options);
if (![429, 500, 502, 503, 504].includes(response.status) || attempt >= 4) {
return response;
}
const retryAfter = Number(response.headers.get('Retry-After'));
const delay = Number.isFinite(retryAfter)
? retryAfter * 1000
: Math.min(8000, 500 * 2 ** attempt) + Math.random() * 250;
await new Promise((resolve) => setTimeout(resolve, delay));
return requestWithBackoff(url, options, attempt + 1);
} Request IDs and support
Log the response status, error code, request ID, endpoint and safe API-key prefix. Never log or email the complete Authorization header.
When contacting support, include the request ID and approximate UTC time at exchangedz.com@gmail.com.