Errors
Errors use RFC 7807 application/problem+json with an extra machine-readable code:
{ "status": 403, "title": "This API key lacks the required 'purchase' scope.", "code": "api_key.insufficient_scope"}Always branch on code, not on the human-readable title.
Common codes
Section titled “Common codes”| HTTP | code |
Meaning |
|---|---|---|
| 400 | order.invalid |
Invalid order/automation parameters (volume, duration, address) |
| 400 | validation_failed |
Request failed validation; per-field messages are in errors |
| 401 | unauthorized |
Missing, invalid or revoked key (WWW-Authenticate: ApiKey …) |
| 402 | wallet.insufficient_balance |
Not enough TRX available. Orders and address activations can spend only your available balance: your TRX balance minus what your active automations hold for their next firing (one refill, renewal or smart delivery each). The message says how much is available; GET /wallet/balance returns it as trxAvailable |
| 403 | api_key.insufficient_scope |
Key’s scope is below what the endpoint requires |
| 403 | api_key.spend_limit_exceeded |
Would exceed the key’s daily spend limit |
| 429 | rate_limited |
Too many requests |
| 502 | provider.upstream_error |
Energy provider temporarily unavailable (any charge is refunded). On automation pause / resume / cancel the rule keeps its previous status — retry, it’s safe |
| 503 | pricing.unavailable |
The price is temporarily unknown. Nothing was charged and nothing was created — retry after the Retry-After header; for orders, reuse the same Idempotency-Key. We never quote or charge a zero price instead |
Validation errors (bad request bodies) carry code: "validation_failed" and an errors object keyed by field:
{ "status": 400, "title": "One or more validation errors occurred.", "code": "validation_failed", "errors": { "volume": ["The value 'abc' is not valid."] }}Business errors carry a domain code and a human-readable title/detail instead of errors.