All Ratio API errors follow a consistent JSON format with machine-readable codes for programmatic handling and human-readable messages for debugging.Documentation Index
Fetch the complete documentation index at: https://docs.ratiofx.com/llms.txt
Use this file to discover all available pages before exploring further.
Error response format
Machine-readable error code. Use this field for programmatic handling — do not parse
message.Human-readable description of the error.
Affected corridor, if applicable.
ISO 8601 server timestamp.
Unique request identifier. Include this when contacting support.
FX Engine errors
These errors originate from the FX Engine and are specific to quote and execution operations.| HTTP | Code | Description | Resolution |
|---|---|---|---|
400 | BELOW_MIN_TRANSACTION_SIZE | Amount is below the minimum for this corridor | Increase amount to meet the corridor’s minimum transaction size |
400 | DIRECTION_BLOCKED | Trade direction not permitted under current state | Wait for state recovery or try the opposite direction |
400 | ARB_CHECK_FAILED | Quote failed internal arbitrage validation | Re-request — market conditions may have shifted |
400 | QUOTE_EXPIRED | Firm quote has expired | Request a new firm quote at current rates |
422 | NO_VIABLE_RFQ_QUOTE | No acceptable external quote available | Retry with a smaller size or wait for liquidity to improve |
422 | CROSS_LEG_INSUFFICIENT | Insufficient liquidity for cross-corridor execution | Retry with a smaller size |
503 | ORACLE_STALE | Oracle price data is outdated | Wait for oracle recovery (typically seconds) |
503 | ORACLE_DEVIATION | Oracle sources diverge beyond threshold | Wait for oracle convergence |
503 | QUOTE_HALTED | System is in HALT state — no new quotes | Wait for system recovery; monitor GET /v1/system/state |
General API errors
| HTTP | Code | Description | Resolution |
|---|---|---|---|
401 | UNAUTHORIZED | Missing or invalid Bearer token | Check your API key |
403 | FORBIDDEN | Valid token but insufficient permissions | Request the appropriate access scope from your account manager |
404 | NOT_FOUND | Resource does not exist | Verify the corridor name, quote ID, or endpoint path |
429 | RATE_LIMITED | Too many requests | Implement exponential backoff; respect the Retry-After header |
500 | INTERNAL_ERROR | Unexpected server error | Retry after a short delay; contact support if errors persist |
Retry guidance
| HTTP range | Category | Recommended action |
|---|---|---|
| 400 | Client error or timing issue | Fix the request parameters or request a fresh quote. Do not retry the same request. |
| 422 | Liquidity or size constraint | Reduce trade size, try a different corridor, or wait for liquidity to improve. |
| 429 | Rate limit | Wait for the duration specified in the Retry-After header, then retry. |
| 500 | Server error | Retry with exponential backoff (1s → 2s → 4s → 8s). Contact support if errors persist. |
| 503 | System-level issue | Wait 5–30 seconds and retry. Check GET /v1/system/state for corridor availability. |
Best practices
- Always check
error.codefor programmatic handling. Do not parse themessagestring — it is intended for human debugging only and may change. - Log
error.request_idfor every error response. This is essential for support escalation. - Monitor
GET /v1/system/stateproactively rather than waiting for503errors. This lets you disable corridors in your UI before users encounter failures. - Implement graceful degradation. When a corridor enters a protective state, show users a clear message rather than exposing raw error codes.
- Use exponential backoff for
500and503retries to avoid overwhelming the system during recovery.