Orders
Cost estimates and energy orders
POST /estimate
Estimate the cost
Authentication: Required — an API key in Authorization: Bearer … (authentication).
A reference calculation: how much energy is needed and what it costs. It reserves nothing, and it is not a final price: it is the price an order would be created with at this moment, and an order's price can still be raised at fulfillment when the market is dearer than it leaves room for (see "Order price" above). Recipients on Tether's USDT blacklist are flagged and not accepted into orders.
The estimate refuses nothing about an address. Everything it
notices comes back as warnings on the item, including the things
that would be a refusal on POST /orders: an estimate reserves
nothing, so there is nothing here to protect by refusing, and an
integrator pricing a batch needs to see every position, not the ones
that survive.
A volume is the other half of that sentence and is refused where
an order would refuse it — the bounds and the lease rule are the
order's own (400, below). A price quoted for a body no order
accepts would be worse than a refusal: it would look like a quote.
from is optional. Give it and the sender is asked two questions
— is it activated on chain, is it on Tether's blacklist — and both
answers arrive as inactive_sender and blacklisted_sender on that
item. Each has a counterpart at order creation, and a different one:
a non-activated sender is a 422 in modes a and c, while a
marked sender is a 422 in mode b alone, with
details.reason = blacklisted_wallet — there we hold the signed
transaction and broadcast it ourselves, so a wallet that cannot move
USDT is a transfer the network refuses after we paid for its energy.
In modes a and c the sender's mark is not checked at all and
never refuses an order: it forbids that address to move USDT, not to
receive energy, and what you want the energy for is your business.
Omit from and the item says nothing about the sender; the older
request shape, with to alone, keeps its old meaning.
duration_s names the lease being priced. Three products exist —
300 (5 minutes), 3600 (1 hour) and 86400 (1 day) — and the
values accepted here are the ones on sale, which may be a shorter
list and moves without a new version of this document. The one-day
lease has been off sale since 2026-10-25, and products[] says what
is on sale today. Read it from products[].duration_s of
GET /tariff instead of hard-coding the list: which durations we
sell is data, not schema, and a client that
decides for itself will offer a lease the order refuses. Send nothing and you price the five-minute lease,
exactly as before; the response echoes back whichever product priced
the answer.
A duration we are not selling is 400 invalid_request naming the
allowed values in the message and, in details, both the refused
duration_s and allowed — never the price of the nearest product:
adjacent leases cost similar money, so that answer would look
plausible and refer to different goods.
Or price a volume instead of transfers. Send energy_units
rather than transfers and the answer is about that number: its
price, and coverage — how much of it the market could supply right
now. Both halves are worth calling for before a large mode c
order. The price is the one an order for this volume on this lease
would be created with at this moment: energy_units × the current price from
GET /tariff, or × our cost floor when assembling the volume
costs more than the current price (see total_trx) — so it is not
always arithmetic you can do from GET /tariff. Whether the volume
is there today is coverage. Exactly one of the two fields; both
together are 400 invalid_request with
details.reason = kind_and_energy_units.
Request body
Required.
Content type application/json.
Exactly one of transfers, energy_units must be sent.
| Field | Type | Required | Description |
|---|---|---|---|
energy_units | integer | optional | Price a volume instead of a list of transfers — the
same number a mode The answer echoes the volume back in Outside the bounds the answer is Minimum: |
transfers | array of object | optional | Minimum items: |
transfers[].to | TronAddress | required | |
transfers[].from | TronAddress or null | optional | The wallet that will sign the transfer, if you
already know it. Optional and advisory: it changes
nothing about the price, only what the item's
|
duration_s | integer | optional | Seconds of lease the prices are asked for — one of the
products on sale, listed by Anything not on sale is With Default: |
Example: Two ordinary wallets
{
"transfers": [
{
"to": "TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9"
},
{
"to": "TMu1y9vAczkdbXZFefE1rf6USo45k1PMUf"
}
]
}
Example: A contract recipient (here, the USDT TRC-20 contract)
Not a mistake and not a special call — the same request with
a recipient that happens to be a contract, shown because the
answer looks different. A contract has its own transfer
logic, so the 65,000 / 131,000 figures do not apply to it:
we price it from an actual dry-run of the transfer, the item
comes back with kind: custom and an energy_units that is
neither of the two standard numbers, and warnings carries
contract_recipient.
The warning is a heads-up, not a refusal: unlike a blacklisted recipient, a contract is accepted into an order. If you did not mean to send USDT to a contract, this is where you find out.
{
"transfers": [
{
"to": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
}
]
}
Example: Pricing a transfer whose sender is already known
What a gas station in front of a custody withdrawal sends:
both addresses and the lease it is about to buy. The price
is the same as it would be without from — the sender is
asked about only so the answer can carry
inactive_sender / blacklisted_sender before the money
moves rather than as a 422 after it.
{
"duration_s": 300,
"transfers": [
{
"from": "TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9",
"to": "TMu1y9vAczkdbXZFefE1rf6USo45k1PMUf"
}
]
}
Example: The same batch priced as a one-hour lease
A longer product is the same request with another
duration_s. The answer's shape does not change — only the
numbers and the duration_s echoed back with them. The
value has to be on sale at that moment
(GET /tariff → products[].duration_s); a duration that
is not comes back as 400 invalid_request whose details
carries the refused duration_s and allowed.
{
"duration_s": 3600,
"transfers": [
{
"to": "TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9"
},
{
"to": "TMu1y9vAczkdbXZFefE1rf6USo45k1PMUf"
}
]
}
Example: A volume rather than a list of transfers
What to send before a large mode c order: no addresses,
one number, and an hour of lease because the volume is
above 131,000. The answer prices it and says, in
coverage, how much of it could be assembled right now.
{
"duration_s": 3600,
"energy_units": 1000000
}
Responses
200
OK
Content type application/json.
| Field | Type | Required | Description |
|---|---|---|---|
energy_units | integer or null | required | The volume this estimate priced, echoed back — present
only when you asked for one. Example: |
coverage | object or null | required | How much of A floor, not a promise. It is computed from the capacity suppliers publish about themselves: a figure they can revise between this answer and your order, and one we cannot audit. A supplier that publishes no capacity figure is not counted — it is not treated as unlimited — so the real market is at least this large and usually larger. Read it as "this much is certainly there", never as "this much is reserved": nothing here is reserved, and the same volume may be sold to someone else a second later. This is the answer to "is it there". The
|
coverage.fillable_units | integer | required | How many units the published capacity adds up to, counted only up to what you asked for. Example: |
coverage.complete | boolean | required | Whether that reaches |
coverage.checked_at | string (date-time) | required | When the capacity figures behind this were read. They age: a stale floor is a floor about a market that has moved. Example: |
items | array of object | required | One entry per transfer asked about. Empty when the request named |
items[].to | TronAddress | required | |
items[].kind | TransferKind | required | |
items[].energy_units | integer | required | Example: |
items[].price_trx | TRX | required | |
items[].warnings | array of string | required | What we noticed about this transfer's addresses.
Empty is the ordinary case, and more than one can
appear at once. The first three are about
Each item — One of: |
total_trx | TRX | required | The price. For Either way this is the price an order is created
with, not a guaranteed final price: a market dearer at
fulfillment than this price leaves our minimum margin
under raises the order's price, the difference held from
your balance (see "Order price" in the introduction).
Where that raise cannot be made — the balance is short
of it, or it is above the cap — the position is refused
at purchase or delivered short (see |
burn_cost_trx | TRX | required | What the transfer would have cost by burning TRX |
duration_s | integer | required | The lease these prices are for, in seconds — the value you sent, or the default if you sent none. Echoed rather than left implied: how long the energy lives is the one thing an estimate must not leave to be looked up. Example: |
400
Malformed request. Where the request was well-formed but asked
for something we do not price, details.reason says which — the
same words the order gives for the same conditions:
bulk_disabled — volume estimates are switched off. The field
is in the contract and the service is not serving it; nothing
about the request will change that, and transfers still works.
bulk_volume_out_of_range — energy_units is outside the bounds
the schema declares. details: energy_units, min_units,
max_units.
bulk_needs_longer_lease — a volume above 131,000 was asked for
against a lease shorter than 3600 s. details: energy_units,
duration_s, min_duration_s.
None of the three carries an index, and that is the only way
they differ from the order's: an estimate prices one volume and
has no positions to point at.
kind_and_energy_units — the body named both transfers and
energy_units. Exactly one of them. The word is the order's,
where the pair is kind and energy_units; it is one word
rather than two so that a client can branch on "you named the
volume twice" once.
energy_units is read as the schema declares it: an integer,
and only an integer. A JSON string or a fractional number is
the ordinary details.errors, not a coercion — and so is an
explicit null in the field you did not choose, on either side
of the either/or: a body omits the alternative it did not take.
Content type application/json.
Schema: Error.
429
Rate limit exceeded (rate_limited), or too many failed
authorizations from this credential (too_many_auth_failures). Both
are 429 and both carry Retry-After; they differ in what you
should do about it, which is why they differ in code and not only
in message. rate_limited also carries the RateLimit-* state of
the bucket it came from; too_many_auth_failures does not, because
the counter behind it is not a bucket. See "Rate limits" and
"Repeated authorization failures" above.
On POST /orders a rate_limited may also carry
details.reason = bulk_volume_cap: not requests per minute but
energy per window — a mode c order whose volumes would take
your account past the bulk allowance. details carries cap_units
(the allowance), spent_units (your volume already inside the
window), requested_units (what this order asked for) and
window_s (the width of the window, 3600). Retry-After is the
first instant at which this body can be accepted: enough of your
counted volume has to leave the window to make room for
requested_units, which is not in general the moment the oldest
position leaves — one departure frees only that position's units.
An order whose own volume is larger than the whole allowance is not
answered here at all: no waiting would help it, and it is
400 invalid_request with
details.reason = bulk_order_over_cap. It is a pace limit like the
others, so it is the same code: the order is not wrong, and the same
body sent later is accepted. It carries no RateLimit-* headers:
those describe a bucket of requests per minute, and this allowance
is energy per hour — details above is its whole state.
Content type application/json.
Schema: Error.
| Header | Type | Description |
|---|---|---|
Retry-After | integer | Seconds to wait before retrying. |
RateLimit-Limit | integer | Requests per minute in this bucket — per UTC day on
|
RateLimit-Remaining | integer | Requests left in this bucket right now. |
RateLimit-Reset | integer | Seconds until the bucket is full again. |
503
We temporarily cannot accept the request: no purchasing quota with
the energy providers, or the TRON network is unavailable (without
it we cannot check the recipient against the blacklist or the
sender's activation). For a volume (energy_units), also when the
market data its price would be built from is out of range: nothing
is reserved or charged. Retry later.
Content type application/json.
Schema: Error.
POST /orders
Create an energy order
Authentication: Required — an API key in Authorization: Bearer … (authentication).
Creates an order and places a hold on the balance. Processing is
asynchronous: the response is 202, then the status changes to
ready (webhook order.ready).
Important: after ready you have until send_before — the lease
you bought, less a 3-second safety margin. On the five-minute
product that is 297 seconds; on the one-day product 86 397. Send the
transaction as soon as you get the signal and not near the deadline:
3 seconds is arithmetic, not slack (see send_before in the
schema). In
mode b that window is also capped by the expiry of the signed
transaction you sent (less a broadcast margin), so it can be far
shorter than the lease: read send_before rather than computing it
from duration_s.
duration_s chooses the lease, and the durations accepted are
the ones on sale — products[].duration_s of GET /tariff, in
ascending order. Omit the field and the order is the five-minute
one it has always been. A duration we are not selling is
400 invalid_request whose details carries the refused
duration_s and allowed, the accepted values;
we do not quietly move the order to the nearest product, because
adjacent leases cost similar money and the substitution would look
like the order you sent.
How to wait. The 202 carries Location — the order's own URL,
the one to poll — and Retry-After, the number of seconds to wait
before the first poll and between polls. Read them from the
response instead of assembling the URL and inventing an interval:
polling faster than Retry-After (currently 2 s) returns the same
answer and spends your rate limit, and the value is served exactly
so that we can change it without breaking your loop.
Better still, do not poll: subscribe to the order.ready webhook.
It arrives at the moment the energy is delegated and carries
send_before, which is the number you plan around — a poller
learns the same thing later by definition.
Idempotency: the same Idempotency-Key with a byte-identical body
returns the original order; with a different body —
409 idempotency_conflict. A request that fails validation does
not consume the key.
Two checks come before the network is asked anything, right
after the body's own form: the balance must cover the least the
batch could cost — every transfer of modes a and b counted at the
cheapest a USDT transfer is priced at, mode c at its stated volume —
or the answer is 402 insufficient_balance with that lower bound in
required_trx; and the account's node budget (see "Rate limits")
must have room for the body's transfers, or it is 429 rate_limited.
So an account with nothing on it gets its 402 before any
422 about the addresses. The 402 that comes after the network
names the exact price and may ask for more than the first one did —
recipients with no USDT make a transfer double. A mode b order
that auto_topup would park is not refused by the first check: it
is priced exactly and parked as before.
Three modes, and mode chooses between them. In a you name
the transfer and send it yourself; in b you hand us the signed
transaction and we broadcast it. In c there is no transfer at
all — you name a wallet and a volume, and the energy is delegated
there. Only a and b derive how much energy a transfer needs
from the recipient's USDT balance; c has no recipient to read,
so the volume is yours to state and yours to get right — as a
kind (one transfer's worth) or as energy_units, any number
between the bounds that field declares.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
Idempotency-Key | header | required | string | A unique request string (e.g., a UUID). A retry returns the original order. Body equality is checked by hashing the raw bytes of the
request, not the parsed JSON: a retry must be byte-identical.
Changed key order, whitespace or number formatting yields
The key is bound only to a created order. A request rejected by
validation ( Minimum length: |
Request body
Required.
Content type application/json.
One of: OrderRequestModeA or OrderRequestModeB or OrderRequestModeC.
The variant is chosen by mode: a → OrderRequestModeA, b → OrderRequestModeB, c → OrderRequestModeC.
OrderRequestModeA
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | required | Always |
transfers | array of object | required | Minimum items: |
transfers[].from | TronAddress | required | |
transfers[].to | TronAddress | required | |
duration_s | integer | optional | How long the energy is leased for, in seconds — one of the
products on sale ( It decides two things at once: the price of every position
( No Default: |
client_ref | string or null | optional | Your identifier for reconciliation Maximum length: |
OrderRequestModeB
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | required | Always |
transfers | array of object | required | Minimum items: |
transfers[].signed_tx | string | required | The signed transaction in hex. The private key is never transmitted. Only a The transaction must remain valid for at least 3 minutes
at the moment the order is created — it has to survive
energy delivery and the broadcast — and for no more than
24 hours less a minute, past which no node accepts it.
Its TAPOS reference must be the usual shape: two bytes of
Its own expiry also shortens |
duration_s | integer | optional | The lease, in seconds — same rule and same allowed values as in
mode A long lease does not lengthen Default: |
client_ref | string or null | optional | Maximum length: |
OrderRequestModeC
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | required | Always |
transfers | array of object | required | Minimum items: |
transfers[].from | TronAddress | required | The wallet the energy is delegated to. It must be activated on chain, or the order is refused with |
transfers[].kind | EnergyKind | optional | |
transfers[].energy_units | integer | optional | How much energy this wallet is to receive, in units —
instead of Above 131,000 the order's Outside
The per-unit price is set when the order is created.
It is the product's current price, or higher when
assembling this volume from the market at that moment costs
more than the current price covers; it is never lower than
the current price. The per-unit price can be raised while the volume is being filled (see "Order price" in the introduction): before the first piece is bought, or between pieces, when what the market sells the rest for leaves less than our minimum margin under it. The raise covers the whole position, units already delivered included, and is held from your balance before anything more is bought; a raise nothing more was bought after is taken back when the fill ends short. It never goes below the price at creation. You are billed per unit that arrives. The price you
are quoted is Minimum: |
transfers[].allow_partial | boolean | optional | Whether to start filling a volume the market visibly
cannot cover. Meaningful only beside
Neither setting can undo a delegation. Once the first
piece has been bought it is on your wallet for the lease,
so a market that moves during the fill — capacity gone, a
source refusing — ends that fill where it stands, on
It is per position. In a batch, one position may accept a short fill while another insists on the whole volume. Default: |
duration_s | integer | optional | The lease, in seconds — same rule and same allowed values as in
mode This is the mode where a long lease means most: there is no
transfer to send, so the whole product is "this wallet has
energy until A position asking for more than 131,000 Default: |
client_ref | string or null | optional | Your identifier for reconciliation Maximum length: |
Example: One transfer, mode A
{
"mode": "a",
"transfers": [
{
"from": "TQ5NMqJjW8sBGqcpvUcXhbXm3jGnyDCmwK",
"to": "TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9"
}
],
"client_ref": "invoice-1042"
}
Example: Batch, mode A
{
"mode": "a",
"transfers": [
{
"from": "TQ5NMqJjW8sBGqcpvUcXhbXm3jGnyDCmwK",
"to": "TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9"
},
{
"from": "TQ5NMqJjW8sBGqcpvUcXhbXm3jGnyDCmwK",
"to": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
}
]
}
Example: Signed transaction, broadcast on our side
{
"mode": "b",
"transfers": [
{
"signed_tx": "0a02f1e22208...c1054d"
}
]
}
Example: Energy for a wallet, no recipient named
{
"mode": "c",
"transfers": [
{
"from": "TQ5NMqJjW8sBGqcpvUcXhbXm3jGnyDCmwK",
"kind": "single"
}
]
}
Example: The same wallet, energised for an hour
A longer lease is the same body with duration_s on it. The
wallet keeps the energy for the whole term, so
send_before lands 3 597 seconds out rather than 297 —
one field decides both the price and the window.
{
"mode": "c",
"duration_s": 3600,
"transfers": [
{
"from": "TQ5NMqJjW8sBGqcpvUcXhbXm3jGnyDCmwK",
"kind": "double"
}
],
"client_ref": "treasury-wallet-september"
}
Example: A million units on one wallet, all or nothing
The volume is named instead of kind, so the item comes
back with kind: bulk. An hour of lease because the
volume is above 131,000: it is assembled from whichever
sources are cheapest and the pieces land seconds apart,
each leasing from its own delegation.
allow_partial is left out, so the default stands: if the
market cannot cover the whole million when we look — at
the position's price, or at the price it is raised to when
the market is dearer and your balance covers the raise (see
"Order price" in the introduction) — nothing is bought,
nothing is charged and the position ends failed with
purchase_failed. Ask POST /estimate with
the same energy_units first if you want to know whether
it is there. That check is made before the first purchase
and cannot be repeated afterwards — a market that empties
mid-fill leaves the position delivered short and billed for
what arrived.
{
"mode": "c",
"duration_s": 3600,
"transfers": [
{
"from": "TQ5NMqJjW8sBGqcpvUcXhbXm3jGnyDCmwK",
"energy_units": 1000000
}
],
"client_ref": "payout-batch-2026-09-09"
}
Example: The same volume, taking whatever can be had
allow_partial: true turns the up-front refusal into a
short fill: the volume is accepted even when the market
visibly does not hold it, the position is delivered with
less than a million, energy_delivered says how much, the
charge is that number at the same per-unit price, and the
order ends partially_completed.
{
"mode": "c",
"duration_s": 3600,
"transfers": [
{
"from": "TQ5NMqJjW8sBGqcpvUcXhbXm3jGnyDCmwK",
"energy_units": 1000000,
"allow_partial": true
}
]
}
Responses
202
Order accepted for processing.
Normally the status is funded — the money is reserved and the
purchase has started. In one case it is awaiting_funds
instead: mode b, auto_topup enabled, and the balance short.
The signed transaction is held, no reserve is taken, a top-up
request goes out, and fund_before says how long the deposit
has. Branch on status, not on the code: a parked order is
accepted, not delivered. A mode c order that named volumes is
accepted the same way, and how much of each volume actually
arrived is read later from the items' energy_delivered.
Content type application/json.
Schema: Order.
| Header | Type | Description |
|---|---|---|
Location | string | The order's own URL — |
Retry-After | integer | Seconds to wait before the first poll and between polls (currently 2). Read the header rather than hard-coding the number. |
400
Malformed request. Where the request is well-formed but names an
order we will not take, details.reason says which. Six of
these belong to a mode c position that named energy_units,
and each of them names the position in details.index except
where it is said below that it does not:
bulk_disabled — volumes are switched off. kind positions are
unaffected, and nothing about the volume in the request will
change this answer. No index: it is about the service, not
about a position.
bulk_volume_out_of_range — energy_units is outside the
bounds the schema declares. details: index, energy_units,
min_units, max_units.
bulk_needs_longer_lease — a volume above 131,000 against a
lease shorter than 3600 s. The volume arrives in pieces whose
leases each start at their own delegation, seconds apart, and a
five-minute lease cannot hold them together. details: index,
energy_units, duration_s, min_duration_s.
duplicate_bulk_address — a wallet that takes a volume was
named by another position of the same order. Delivery on a
volume position is measured as the growth of that wallet's
energy over a reading taken before the first purchase, so
anything else delegated to it in the same order is counted as
our delivery — a short fill confirmed as whole, and billed as
whole. It makes no difference what the neighbouring position is:
another volume or a kind. details: index and first_index,
the two positions. Order them separately, or ask for their sum in
one volume position.
bulk_order_over_cap — the order's volumes add up to more than
your account's whole hourly allowance. No index: the sum
belongs to the order rather than to any one position. details:
requested_units and cap_units. Distinct from the 429
(bulk_volume_cap) on purpose: that one means "the same body,
later", and this one has no later — the allowance is emptiest
when the window is empty, and this order does not fit even then.
Split it across hours, or ask for less.
kind_and_energy_units — a position named both. Exactly one of
them: there is no rule saying which would win. details:
index. A position naming neither is the same code with the
ordinary details.errors, and the entry there names the
position (body.c.transfers.0).
A malformed position is refused before any of this, by the
request schema: naming both fields or neither, sending null in
the field you did not choose, or sending energy_units as a JSON
string are all answered without the service being consulted — so
such a body gets kind_and_energy_units (or the schema error)
even where volumes are switched off and bulk_disabled would
otherwise be the answer.
All six refuse the order, not the position — one is enough —
and none of them consumes the Idempotency-Key.
Mode b adds five more, about the signed transaction itself:
rules every node enforces, so a transaction breaking one would be
refused by the network, or run out of energy, after we bought its
energy. All five carry details.index, the transaction in the
batch (the first such transaction, if several break the rule):
expiration_too_far — the transaction's expiration leaves it
more than 86,340 seconds of life when we receive it (24 hours
less a minute: no node accepts a deadline more than a day past
its head block). Sign it again with a nearer deadline. Too
little life — under 180 seconds — is refused too, with
details.index alone, as it always was.
ref_block_invalid — the TAPOS reference is not two bytes of
ref_block_bytes and eight of ref_block_hash, a shape no node
can look up. Build it again against a recent block, as wallets
do.
ref_block_unknown — the reference has the right shape, but the
block the network holds under those two bytes has another id: it
is older than the last 65,536 blocks (about 54 hours) a node
remembers, from another network (Nile, Shasta), invented, or a
block the network has just replaced (a fork). We ask the chain
before accepting the order. Build the transaction again against
the current block of mainnet. When we cannot get an
answer from the chain, the order is accepted rather than refused,
and a node's TAPOS_ERROR after delivery is billed as before.
malformed_tx — the bytes are not what a node's parser would
read the way we do: a field the transaction format does not have
at that level (an outer ret, raw_data.auths or scripts, a
TRC-10 attachment on the call), a field written twice, a nested
message that does not parse, a varint in a longer spelling than
its value needs, a field the transfer needs that is missing or of
another type, a deadline no int64 holds, or a type_url other
than exactly type.googleapis.com/protocol.TriggerSmartContract.
Inside raw_data the shape a node re-encodes before hashing is
required too — fields in ascending number, no field written with
its default (0, empty) — because a node checks the signature
against its own re-encoding and refuses any other shape. The
outer envelope's two fields may come in either order. What a
wallet's encoder writes passes; build the transaction with one.
fee_limit_too_low — the transaction's fee_limit cannot pay
for the energy the transfer needs at the network's current
price. A node caps a call at fee_limit / energy price units and
counts the energy we delegate against that cap as it counts TRX
it would burn, so below the transfer's requirement it runs out
of energy however much we deliver; a transaction without a
fee_limit (the field left out, which is zero) gets no energy
at all. A fee_limit of at least the position's burn_cost
from POST /estimate always passes: it is the requirement times
the same price. It is a ceiling, not a spend — with the energy
delivered, none of your TRX is burnt unless the transfer costs
more than its estimate (a recipient whose USDT balance emptied
after the dry run doubles it): the difference is then burnt from
the sender's TRX, up to the fee_limit. Checked after the dry run,
whose measurement is the requirement of an unusual transfer.
Every other refusal of a signed transaction is the same
400 invalid_request with details.index alone.
Content type application/json.
Schema: Error.
Example: A million units asked for on a five-minute lease
{
"error": {
"code": "invalid_request",
"message": "A volume above 131000 units needs a lease of 3600 s or longer",
"details": {
"reason": "bulk_needs_longer_lease",
"index": 0,
"energy_units": 1000000,
"duration_s": 300,
"min_duration_s": 3600
}
}
}
Example: A position named both the kind and the volume
{
"error": {
"code": "invalid_request",
"message": "A position names either kind or energy_units, not both",
"details": {
"reason": "kind_and_energy_units",
"index": 0
}
}
}
402
Insufficient balance.
Answered at one of two points. Before the network is asked
anything, when the balance does not cover even the cheapest price
the batch could have: required_trx is then that lower bound,
the least to add before the same body is priced at all. After
it, when the exact price is known and does not fit:
required_trx is the exact price. The two can follow each other on
the same body — top up by the first figure, repeat, and the second
names the rest — so read required_trx from the latest answer.
With auto_topup on, the request a refusal of the first kind
raises is not sized from that lower bound but from every
transfer priced as a double (mode c: its own kind or volume),
so topup_amount_trx there exceeds required_trx, and paying
exactly it lets the same request through; what it overshoots stays
on your balance. A second 402 after such a payment remains
possible when the price or your free balance changed before the
retry, and where the exact price is above a double: a mode b
transfer whose dry run measures more (sold as custom), a
recipient contract whose transfer costs more, or a mode c volume
whose cost floor is above the current price. It then names a new
topup_request_id — the payment closed the first.
A mode b order with auto_topup enabled does not come back
here — it is parked and answered 202 with the status
awaiting_funds (see above). This 402 remains the answer for
modes a and c, for any mode with the policy off, and for a
mode b transaction with too little life left to be worth
waiting on.
Content type application/json.
Schema: Error.
Example: The plain refusal — auto_topup is off
{
"error": {
"code": "insufficient_balance",
"message": "Insufficient balance: 4.160000 TRX required, 1.020000 TRX available",
"details": {
"required_trx": "4.160000",
"available_trx": "1.020000"
}
}
}
Example: The same refusal with auto_topup enabled: a top-up request has been raised for the difference
The order was not created and the Idempotency-Key
was not consumed — send the TRX to deposit_address and
repeat the same request. The request also arrives as
topup.requested and is readable at
GET /topup-requests/{topup_request_id}.
Read the three fields by presence. They are absent whenever no request could be raised — see the next example.
{
"error": {
"code": "insufficient_balance",
"message": "Insufficient balance: 4.160000 TRX required, 1.020000 TRX available",
"details": {
"required_trx": "4.160000",
"available_trx": "1.020000",
"topup_request_id": "9c4f0b52-31ad-4e6b-8d70-1f2a5c9e7b83",
"topup_amount_trx": "120.000000",
"deposit_address": "TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9"
}
}
}
Example: auto_topup enabled, but no request was raised: the daily cap is spent
The same three fields are missing, and the body is the
plain refusal. Two states produce it: everything left of
auto_topup.max_per_day_trx for this UTC day is already
requested, or what is left of it would not cover the
shortfall — we do not ask for an amount that could not
unblock this order. Either way the answer is 402 and the
fix is yours: top up by however much you like, or raise the
cap in PATCH /settings.
{
"error": {
"code": "insufficient_balance",
"message": "Insufficient balance: 4.160000 TRX required, 1.020000 TRX available",
"details": {
"required_trx": "4.160000",
"available_trx": "1.020000"
}
}
}
422
The addresses are well-formed, but the order cannot be taken on them. Three codes, and they are different situations:
blacklisted_recipient — the recipient is on the USDT
blacklist and cannot receive the transfer at all
(details.index, details.address).
invalid_address with details.reason = inactive_wallet — the
from address is not activated on chain, so there is nowhere
to delegate the energy to. Modes a and c; in mode b the
transaction is already signed by the owner, so the account
exists. details.index says which transfer of the batch,
details.address which address. It is the same reason word
POST /auto-refill-rules gives for the same condition.
Two more reasons are mode b only and about the sender: we
hold the signed transaction and we broadcast it, so a wallet
that cannot move the USDT it signed away is a transfer the
network will refuse after we paid for its energy. They are one
code and two different situations, and what you do next differs.
invalid_address with details.reason = insufficient_usdt —
the sender does not hold what its own transfers move. The
amounts travel with the refusal as details.required_usdt and
details.available_usdt, and the requirement is summed per
sender across the batch — ten transfers of 2 USDT from a
wallet holding 5 need 20, and details.index names the first
one the wallet cannot cover. Fund the wallet and resubmit.
The sum also covers what your other orders have not sent
yet: a wallet holding 5 USDT cannot be accepted for 5 in one
order and 4.999999 in a second, because only one of the two
transactions can succeed on chain and the loser reverts after
its energy has been delivered. So details.required_usdt may
exceed what this body alone moves — it is the total the wallet
has to be able to move for every transfer of yours whose
outcome is not yet settled on chain.
An item counts while its status is pending, delegated,
broadcasting or broadcasted — up to and including one
we have already sent, because until a block carries it the
wallet's balance still answers for it. It stops counting at
confirmed, where the USDT has moved and the balance says so,
and at failed, where it never moved and never will. A retry
of a request under the same Idempotency-Key is not counted
against itself either: it comes back as the original order.
invalid_address with details.reason = blacklisted_wallet —
the sender is on Tether's blacklist and cannot move USDT at
all. details carries reason, index — the first transfer
of the marked sender, this being a mark rather than a quantity
— and address. No amounts come with it: there is no
balance that would make this order pass, so nothing about how
much is required or available is reported, and resubmitting
will not help until Tether lifts the mark. In modes a and
c the same mark is not a refusal: it forbids the address to
move USDT, not to receive energy.
invalid_request with details.reason = dry_run_reverted —
mode b only: we ran the transfer on a node before agreeing to
carry it, and the contract refused it. The node's own word for
the refusal is in details.message. This is not a complaint
about your request — it is well-formed — it is the network's
answer about what would happen, given before the energy is
bought rather than after.
None of these refusals is about your request's shape, and none
of them consumes the Idempotency-Key: the same key can be
retried once the wallet is activated, funded, or another
recipient is chosen. A malformed address is a different
answer — 400 invalid_address, no details.reason.
Content type application/json.
Schema: Error.
Example: The wallet to energise does not exist on chain yet
{
"error": {
"code": "invalid_address",
"message": "The address is not activated on chain",
"details": {
"reason": "inactive_wallet",
"index": 0,
"address": "TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9"
}
}
}
Example: The batch moves more USDT than the sender holds
{
"error": {
"code": "invalid_address",
"message": "The sending address cannot make this transfer",
"details": {
"reason": "insufficient_usdt",
"index": 2,
"address": "TQ5NMqJjW8sBGqcpvUcXhbXm3jGnyDCmwK",
"required_usdt": "6.000000",
"available_usdt": "5.000000"
}
}
}
Example: The contract would refuse the transfer
{
"error": {
"code": "invalid_request",
"message": "The network would reject this transfer",
"details": {
"reason": "dry_run_reverted",
"index": 0,
"address": "TQ5NMqJjW8sBGqcpvUcXhbXm3jGnyDCmwK",
"message": "REVERT opcode executed"
}
}
}
429
Rate limit exceeded (rate_limited), or too many failed
authorizations from this credential (too_many_auth_failures). Both
are 429 and both carry Retry-After; they differ in what you
should do about it, which is why they differ in code and not only
in message. rate_limited also carries the RateLimit-* state of
the bucket it came from; too_many_auth_failures does not, because
the counter behind it is not a bucket. See "Rate limits" and
"Repeated authorization failures" above.
On POST /orders a rate_limited may also carry
details.reason = bulk_volume_cap: not requests per minute but
energy per window — a mode c order whose volumes would take
your account past the bulk allowance. details carries cap_units
(the allowance), spent_units (your volume already inside the
window), requested_units (what this order asked for) and
window_s (the width of the window, 3600). Retry-After is the
first instant at which this body can be accepted: enough of your
counted volume has to leave the window to make room for
requested_units, which is not in general the moment the oldest
position leaves — one departure frees only that position's units.
An order whose own volume is larger than the whole allowance is not
answered here at all: no waiting would help it, and it is
400 invalid_request with
details.reason = bulk_order_over_cap. It is a pace limit like the
others, so it is the same code: the order is not wrong, and the same
body sent later is accepted. It carries no RateLimit-* headers:
those describe a bucket of requests per minute, and this allowance
is energy per hour — details above is its whole state.
Content type application/json.
Schema: Error.
| Header | Type | Description |
|---|---|---|
Retry-After | integer | Seconds to wait before retrying. |
RateLimit-Limit | integer | Requests per minute in this bucket — per UTC day on
|
RateLimit-Remaining | integer | Requests left in this bucket right now. |
RateLimit-Reset | integer | Seconds until the bucket is full again. |
503
We temporarily cannot accept the request: no purchasing quota with
the energy providers, or the TRON network is unavailable (without
it we cannot check the recipient against the blacklist or the
sender's activation). For a volume (energy_units), also when the
market data its price would be built from is out of range: nothing
is reserved or charged. Retry later.
Content type application/json.
Schema: Error.
GET /orders
List orders
Authentication: Required — an API key in Authorization: Bearer … (authentication).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
status | query | optional | OrderStatus | |
client_ref | query | optional | string | |
cursor | query | optional | string | |
limit | query | optional | integer | Default: |
Responses
200
OK
Content type application/json.
| Field | Type | Required | Description |
|---|---|---|---|
data | array of Order | required | |
next_cursor | string or null | required |
GET /orders/{order_id}
Get an order
Authentication: Required — an API key in Authorization: Bearer … (authentication).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
order_id | path | required | string |
Responses
POST /orders/{order_id}/cancel
Cancel an order
Authentication: Required — an API key in Authorization: Bearer … (authentication).
Only possible before energy purchasing has started.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
order_id | path | required | string |