Errors and rate limits: what a payout client must handle
The contract of our API names eighteen error codes, and a payout client needs four reactions to them: change the request, add money, wait and send the same bytes again, or stop and alert a person. Two codes come with the status 429 and ask for opposite things, and eight come with 409, so the HTTP status does not choose the reaction. We took the rules from the API contract and the client documentation of 16 November 2026.
One body for every error the API sends
An error answered by the /v1 API has one shape. On 16 November 2026 we asked for GET /v1/balance with no key and got 401 with this body:
{"error":{"code":"unauthorized","message":"Key not accepted","details":{}}}
code is the field to branch on. message is English prose for a person reading a log, and the contract says it may be reworded at any time. details carries what a program needs beyond the code: when a request fails schema validation, details.errors lists each failed field with its whole path, for example body.transfers.0.to.
The eighteen codes and what to do about each
| What you got | What it means | What the client does |
|---|---|---|
invalid_request, 400 or 422 | The body or the parameters failed validation, or the request broke a rule that details.reason names. | Change the request. |
invalid_address, 400 or 422 | 400: the string is not a valid TRON address. 422: the address is well-formed and cannot be used for this request, and details.reason says why. | Correct the address, or act on the reason. |
blacklisted_recipient, 422 | The recipient in details.address is on the USDT blacklist and cannot receive the transfer. | Take that transfer out of the batch. |
not_found, 404 | The object does not exist, or it belongs to another client; the code is not_found in both cases. | Check the id and the path. A 404 on every /v1/queue-sessions path means queue mode is off for your account; ask support. |
idempotency_conflict, 409 | This Idempotency-Key is already bound to a request with a different body (or, on an append, to another queue session). | An order or a session exists under this key: read it first, then resend the stored original bytes. Use a new key only for a new payout, or after that order is final. |
order_not_cancelable, 409 | The order can no longer be canceled: its purchase has started, or the order has already ended. | Read the order. |
topup_request_not_cancelable, 409 | The top-up request is no longer open: it was paid, it expired or it was canceled. | Read the request. |
maintenance_rule_conflict, 409 | An active Auto-refill rule already exists for this address. | Read the existing rule and change that one. |
queue_session_active, 409 | You already have a session in created, running or paused on this wallet. | Stop that session, or append to it. |
queue_session_closed, 409 | The session is completed or stopped. | Create a new session. |
wallet_busy, 409 | A queue session of another account is using this wallet. | Wait until that session ends, or use another wallet. |
address_book_conflict, 409 | The address is already saved, or a limit of entries or of tags is reached; details.reason says which. | Use the saved entry, or delete entries or tags to get under the limit. |
insufficient_balance, 402 | The available balance does not cover the request; details.required_trx and details.available_trx give the two figures. | Top up and send the request again. Read required_trx from the latest answer. |
rate_limited, 429 | The API key is fine and the pace is too high. | Wait the seconds in Retry-After, then send the request again. |
capacity_unavailable, 503 | We cannot accept the request for now, for example: we have no purchasing quota with the energy vendors, we cannot reach the TRON network, we have paused the service, or, for a volume order, the market data for its price is out of range. | Send it again later. The contract defines no Retry-After on this answer. |
unauthorized, 401 | The API key is missing or invalid, was used from an IP outside its allowlist, or was sent to the wrong host: a live key to the sandbox, a test key to production. | Stop and alert a person. Check the key, its IP allowlist and the base URL; if all three are right, ask support. |
too_many_auth_failures, 429 | We refused too many authorizations from your IP address, or for this key from your IP address. | Stop sending and check the API key and its IP allowlist. Waiting does not fix it. |
internal_error, 500 | A fault on our side. | Alert a person and tell us. Repeating POST /v1/orders with the same bytes and the same Idempotency-Key is safe. |
Both 429 answers carry Retry-After, and waiting helps only with rate_limited. too_many_auth_failures comes from a counter of refused authorizations. We count a request with no key, or with a key we do not know, against the IP address it comes from, and a real key that we refuse against that key at that IP address. While this counter has an IP address shut, every refusal we send to that IP address carries this code, including the refusal of a real key used from outside its allowlist. A key that we accepted recently keeps working from an IP address that this counter has shut.
Failures that come after a 202
An order accepted with 202 can still fail, and no HTTP error reports the failure. The cause is error_code on the failed order and error on its failed positions, with values from a second closed list; the positions of a canceled order close failed with no error. An earlier post covers what each final status means for the money.
Which requests to send again
Two answers mean the request that got them can be sent again unchanged: 429 rate_limited once its wait has passed, and 503 capacity_unavailable. After a 500 on POST /v1/orders, or a timeout with no answer, repeating the request is safe because of the Idempotency-Key header, which the contract requires on that call and on the two calls that create a queue session and add items to a queue session. If the first attempt created the order, a retry with the same key and the same bytes returns that order and creates no second one. A request refused with 400, 402, 422, 429 or 503 creates no order and leaves the key unused. No request can produce 503 capacity_unavailable on purpose, on production or in the sandbox. The post on batch payouts shows how to derive the key for a batch.
The limits in the contract
Our walkthrough of the API gave the first three of these limits. The contract has two more.
| What is counted | Limit | Counted per |
|---|---|---|
| Orders | 120 requests a minute | API key |
Reference requests, such as GET /v1/balance and GET /v1/ledger | 600 requests a minute | API key. Per IP for a request without a key to a public endpoint such as GET /v1/tariff. |
GET /v1/address-check | 60 requests a minute | API key |
POST /v1/webhooks/{webhook_id}/test | 10 requests a minute | API key |
| The node budget: transfers in the bodies of orders and of queue sessions | 1,000 transfers a minute | Account: all its keys and the cabinet share it |
For POST /v1/estimate we count one token of the reference bucket for the call and one more for each unique address in the body that is not in our short-lived address cache, up to the size of the bucket. An estimate of 500 pairs with 1,000 different addresses, none of them in the cache, takes every token of the bucket. Until the bucket refills, GET /v1/balance and GET /v1/ledger with that API key can get 429 rate_limited too, because they take their tokens from the reference bucket as well. The largest order body, 500 transfers, passes on a full node budget.
Pacing by the three headers
A successful answer from a counted endpoint carries the state of its bucket in three headers. Our request for GET /v1/tariff without a key on 16 November 2026 came back with these:
ratelimit-limit: 600 # size of the bucket, in tokens per minute ratelimit-remaining: 599 # tokens left right now ratelimit-reset: 1 # seconds until the bucket is full again
A client that slows down as RateLimit-Remaining falls can avoid the refusal. Two endpoints send none of the three: GET /v1/health has no limiter, and we count requests to GET /v1/contract.yaml without yet reporting the count. Any answer can lack them when our limiter could not read the bucket; the request has then passed uncounted.
Every 429 carries Retry-After in seconds, and what it promises depends on the refusal.
The 429 | Retry-After is | RateLimit-* headers |
|---|---|---|
rate_limited from a request bucket | The seconds to wait before retrying | The state of that bucket |
rate_limited on a POST /v1/estimate that needs more tokens than the bucket has left | The seconds until the bucket is full again | The state of the reference bucket |
rate_limited from the node budget | The seconds until the refused body fits in the node budget | The node budget, in transfers per minute |
rate_limited with details.reason set to bulk_volume_cap (mode C) | The seconds until this body can be accepted | None. The figures are in details. |
too_many_auth_failures | Present, and waiting does not fix the credential | None |
User-Agent, browsers and the contract file
The API requires no User-Agent and refuses no client for the agent string it sends. Send an agent that names your integration anyway: it lets us find your requests in a log. The documentation site does refuse some programmatic clients, Python-urllib among them. The edge in front of that site answers 403 in text/plain with the body error code: 1010 and no error object, because the request never reached us.
So a program takes the contract from the API: GET /v1/contract.yaml serves the file the documentation site renders, byte for byte, with no key. Generate your client from it. Send its ETag back as If-None-Match, and an unchanged contract answers 304.
Endpoints that need a key answer no CORS headers, because a key placed in the code of a page reaches everyone who loads the page. A preflight request to such an endpoint gets 405 invalid_request in the usual error body.
The health endpoint and the status page
GET /v1/health needs no key, and the contract calls it safe to poll. On 16 November 2026 at 09:32 UTC it answered:
{"status":"ok","time":"2026-11-16T09:32:28.712154Z",
"components":{"api":"ok","orders":"ok","delivery":"ok","deposits":"ok"}}
status describes the API: ok, degraded (the API answers while the cache or the node we read from is unhealthy) or down. components.orders says whether an order can be created now: it reads down during a pause even while status reads ok. A component whose state we cannot establish reads down. Our handler answers 200 whatever the state, so a monitor has to read components.orders in the body, and no answer, or any status other than 200, also means down. The status page shows the four components of that answer.
What we did not test
Of the eighteen codes we captured one live, the unauthorized of the request without a key. For the other seventeen we quote the contract and the client documentation of 16 November 2026. We tested no failing proxy and no broken connection; a client should treat an answer without error.code as unknown.
Before the first order, point a monitor at an endpoint that needs no key and has no limiter: read the GET /v1/health operation in the API reference →