nrg.market API reference Interactive reference

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.

FieldTypeRequiredDescription
energy_unitsintegeroptional

Price a volume instead of a list of transfers — the same number a mode c position may name. Exactly one of the two: a body carrying both is 400 invalid_request with details.reason = kind_and_energy_units, one carrying neither is the same code with the usual details.errors.

The answer echoes the volume back in energy_units, prices it in total_trx — the price an order for it would be created with right now, which can be above the current price (see there) — leaves items empty, since there are no transfers to say anything about, and adds coverage, which says whether the volume is on the market.

Outside the bounds the answer is 400 invalid_request with details.reason = bulk_volume_out_of_range. The bounds are the order's, so a volume this endpoint refuses is a volume no order would take either — and, like the order's, they say what we accept, not what is on the market: a number inside them is a number you may ask for, and coverage in the answer is the half that says whether it is there.

Minimum: 65000. Maximum: 50000000. Example: 1000000.

transfersarray of objectoptional

Minimum items: 1. Maximum items: 500.

transfers[].toTronAddressrequired
transfers[].fromTronAddress or nulloptional

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 warnings can tell you.

duration_sintegeroptional

Seconds of lease the prices are asked for — one of the products on sale, listed by products[].duration_s of GET /tariff. Of the three durations that exist (300, 3600, 86400) only some may be on sale at a given moment, so the field carries no enum: an enumeration in a generated client would go stale the day the list moves, and it moves without a release.

Anything not on sale is 400 invalid_request with the allowed list in the message and, in details, the refused duration_s beside allowed.

With energy_units above 131,000 it must be 3600 or longer, exactly as on the order (details.reason = bulk_needs_longer_lease): pricing a volume against a lease no order would accept would quote goods we do not sell.

Default: 300. Example: 300.

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.

FieldTypeRequiredDescription
energy_unitsinteger or nullrequired

The volume this estimate priced, echoed back — present only when you asked for one. null when the request named transfers: there the volume is per item and lives on each of them.

Example: 1000000.

coverageobject or nullrequired

How much of energy_units could be assembled right now. null when the request named transfers.

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 maximum on energy_units is not: that bound says what a request may name, and it is far above what the market takes in one lease on an ordinary day. A volume inside the bounds is a volume we accept; a volume with complete: true here is a volume that was on the market when checked_at says we looked.

coverage.fillable_unitsintegerrequired

How many units the published capacity adds up to, counted only up to what you asked for.

Example: 1000000.

coverage.completebooleanrequired

Whether that reaches energy_units in full. False means an order for this volume would need allow_partial to be accepted at all.

coverage.checked_atstring (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: 2026-09-09T08:00:13Z.

itemsarray of objectrequired

One entry per transfer asked about. Empty when the request named energy_units — a volume has no addresses, so there is nothing per-address to say.

items[].toTronAddressrequired
items[].kindTransferKindrequired
items[].energy_unitsintegerrequired

Example: 65000.

items[].price_trxTRXrequired
items[].warningsarray of stringrequired

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 to, the last two about from and present only if you sent one.

  • blacklisted — the address is on Tether's USDT blacklist. The only one of the five that is a refusal: the position is kept in the estimate so you can see what will fall out, but an order containing it is rejected.
  • inactive_recipient — the address has never been activated on chain. Not a refusal, and not what prices the position either: kind follows the USDT balance alone, so an unactivated recipient that holds USDT is single. Worth checking against your own records — the chain carries no account for it, so nothing on chain confirms it is the one you meant. Only your own records can.
  • contract_recipient — the address is a contract rather than a wallet. Not a refusal either, and it is why kind is custom: a contract runs its own transfer logic, so energy_units comes from a dry-run of the actual transfer instead of the 65,000 / 131,000 figures. Worth checking against your own records — sending USDT to a contract address is more often a mistake than an intention.
  • inactive_sender — the from wallet has never been activated on chain. Here it is advice; the same finding at order creation is 422 invalid_address with details.reason = inactive_wallet, because energy cannot be delegated to an account that does not exist. Activate the wallet and send the order; a retry without activating cannot help. The order does not trust the age of this answer: activation is re-read past the cache before an order is refused for it, so a wallet activated seconds after this estimate is accepted straight away rather than once the cached answer expires.
  • blacklisted_sender — the from wallet is on Tether's USDT blacklist. Advice in modes a and c, where the mark is not checked at all: it stops that address from moving USDT, not from receiving energy, and what you want the energy for is your decision. In mode b it is a refusal — 422 invalid_address with details.reason = blacklisted_wallet — because there we hold the signed transaction and broadcast it, so a marked sender is a transfer the network rejects after we have paid for its energy. Worth reading in any mode: energy delivered to a marked wallet buys a transfer that will not go through.

Each item — One of: blacklisted, inactive_recipient, contract_recipient, inactive_sender, blacklisted_sender.

total_trxTRXrequired

The price. For transfers, the sum of the items' price_trx. For energy_units, the price an order for this volume on this lease would be created with right now: energy_units × a per-unit price in whole sun, which is the higher of two numbers — the current price of GET /tariff for the lease, and our cost floor for the volume: what assembling the whole of it from the market's published capacity costs at this moment. The floor only ever raises the price; where it is under the current price the current price stands. It is read from the same market data as coverage and moves with it, so an order placed a few minutes later can be priced differently, exactly as one placed after the current price was recomputed can. When fresh market data does not cover the whole volume, there is no floor and the current price applies.

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 allow_partial on POST /orders).

burn_cost_trxTRXrequired

What the transfer would have cost by burning TRX

duration_sintegerrequired

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: 300.

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.

401

Invalid key or IP not allowed

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.

HeaderTypeDescription
Retry-Afterinteger

Seconds to wait before retrying.

RateLimit-Limitinteger

Requests per minute in this bucket — per UTC day on POST /sandbox/deposit, the one allowance in this API that is not counted per minute. Absent in exactly three cases, and in none is a number invented for it: the limiter could not read the bucket state (the request is let through then), the answer is too_many_auth_failures, which is counted by the authorization-failure counter and not by a bucket — see "Repeated authorization failures" — or it is the volume allowance (details.reason = bulk_volume_cap), which is energy per hour rather than requests per minute.

RateLimit-Remaininginteger

Requests left in this bucket right now.

RateLimit-Resetinteger

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

NameInRequiredTypeDescription
Idempotency-Keyheaderrequiredstring

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 409 idempotency_conflict — serialize the body once and retry the same bytes.

The key is bound only to a created order. A request rejected by validation (400, 422) does not consume the key: the same key can be used again with a corrected body.

Minimum length: 1. Maximum length: 128.

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

FieldTypeRequiredDescription
modestringrequired

Always a.

transfersarray of objectrequired

Minimum items: 1. Maximum items: 500.

transfers[].fromTronAddressrequired
transfers[].toTronAddressrequired
duration_sintegeroptional

How long the energy is leased for, in seconds — one of the products on sale (products[].duration_s of GET /tariff, ascending). Omitted means the five-minute lease, so a body written before this field existed keeps its meaning exactly.

It decides two things at once: the price of every position (energy_units × that product's current price when the order is created; see "Order price" in the introduction for when it is raised afterwards) and send_before, which is the lease less a 3-second margin. A value we are not selling is 400 invalid_request whose details carries the refused duration_s as well as allowed.

No enum here on purpose: the three durations that exist are fixed, but which of them are on sale is data and moves without a release of this document.

Default: 300. Example: 300.

client_refstring or nulloptional

Your identifier for reconciliation

Maximum length: 128.

OrderRequestModeB

FieldTypeRequiredDescription
modestringrequired

Always b.

transfersarray of objectrequired

Minimum items: 1. Maximum items: 500.

transfers[].signed_txstringrequired

The signed transaction in hex. The private key is never transmitted.

Only a transfer call of the USDT contract is accepted, with a single signature of the sender address owner and no TRX attached. Multisig (Permission_id) is not supported: a permission's key set lives on-chain and can change without our knowledge.

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 ref_block_bytes, eight of ref_block_hash — and name a block of mainnet that nodes still hold, which we check against the chain. Anything else → 400; the ceiling, the TAPOS shape, a reference to a block the chain does not hold and bytes a node would not parse as we read them name themselves in details.reason.

Its own expiry also shortens send_before: the window we promise never runs past the transaction's deadline less a broadcast margin, because a node refuses an expired transaction whatever energy is on the address. Give a transaction more life than the minimum and the window you get is the full one.

duration_sintegeroptional

The lease, in seconds — same rule and same allowed values as in mode a (products[].duration_s of GET /tariff), default 300.

A long lease does not lengthen send_before here. The window is still capped by the expiry of the signed transaction less the broadcast margin, and a TRON transaction lives minutes, not hours: a one-day lease in this mode buys energy that outlives the transaction it was bought for. What it is good for is the same energy standing on the sender for the rest of the term — but the broadcast we promise still happens inside the transaction's own life.

Default: 300. Example: 300.

client_refstring or nulloptional

Maximum length: 128.

OrderRequestModeC

FieldTypeRequiredDescription
modestringrequired

Always c.

transfersarray of objectrequired

Minimum items: 1. Maximum items: 500.

transfers[].fromTronAddressrequired

The wallet the energy is delegated to. It must be activated on chain, or the order is refused with 422 invalid_address and details.reason = inactive_wallet — the same reason word POST /auto-refill-rules uses for the same condition.

transfers[].kindEnergyKindoptional
transfers[].energy_unitsintegeroptional

How much energy this wallet is to receive, in units — instead of kind, and never beside it. The item comes back with kind: bulk.

Above 131,000 the order's duration_s must be 3600 or longer, or the order is 400 invalid_request with details.reason = bulk_needs_longer_lease. A volume that large is not bought in one piece: it is assembled from whichever sources are cheapest at that moment, several of them when no single one can cover it, and the pieces land seconds apart. Each piece's lease starts at its own delegation, so on the five-minute product the first piece would already be expiring while the last was still arriving. An hour is the shortest lease where that spread does not matter.

Outside minimum/maximum the answer is 400 invalid_request with details.reason = bulk_volume_out_of_range, carrying the refused energy_units and the bounds. The upper bound is a single position's; a very large order may also meet 429 rate_limited with details.reason = bulk_volume_cap — see there.

maximum is what we accept, not what is available. It is the ceiling on the number a position may name; whether that much energy can be assembled at the minute you order is a different question, and a volume well inside the bounds can still fail to fill. Nothing here is a supply figure. The answer to "is it there" is coverage from POST /estimate for the same energy_units — its complete in particular — and, if it can be short, allow_partial below is how you say what to do about it.

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. POST /estimate with the same energy_units and duration_s quotes the same number at the same moment (total_trx), so a volume is not always priced at the current price of GET /tariff. When we have no fresh market data covering the whole volume, the current price applies. Several volume positions in one order are filled from the same market, so each is priced at least at what POST /estimate quotes for it alone at that moment, and at least at the price of the dearest part of the market the volumes need together.

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 energy_units × that per-unit price; if less than that arrives, the charge is the same per-unit price times energy_delivered and the rest of the hold comes back. See allow_partial for whether such a volume is taken on at all.

Minimum: 65000. Maximum: 50000000. Example: 1000000.

transfers[].allow_partialbooleanoptional

Whether to start filling a volume the market visibly cannot cover. Meaningful only beside energy_units; on a kind position there is nothing to fill partially.

false (the default) is all or nothing, decided up front: before anything is bought we plan how the whole volume would be bought — over as many rounds of buying as the fill would take, counting only what the sources confirm they would sell — and if the market cannot supply all of energy_units within the position's price — after the raise we make when the market is dearer (see "Order price" in the introduction), where your balance covers it and the cap allows it — nothing is bought at all: the position ends failed with error = purchase_failed and its hold comes back whole. Nothing is charged and nothing is delegated.

true accepts the volume regardless: the fill starts even when it is visibly short, buys what can be had within the position's price, and the position is delivered with energy_delivered below energy_units. Where a single source can supply the whole volume while the cheaper pieces cannot be put together, the volume may be filled from that one source in full rather than short.

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 false as much as on true: the position is delivered short, you are charged energy_delivered at the same per-unit price, the rest of the hold is released and the order ends partially_completed rather than completed. A market that turns too dear during the fill for the rest of the volume to be bought within the position's price, when the raise that would follow it cannot be made (your balance is short of it, or it is above the cap), ends it the same way. Read the status, not the absence of an error. If you need to know whether the volume is there before you order, ask POST /estimate for the same energy_units and read coverage.complete.

It is per position. In a batch, one position may accept a short fill while another insists on the whole volume.

Default: false.

duration_sintegeroptional

The lease, in seconds — same rule and same allowed values as in mode a (products[].duration_s of GET /tariff), default 300.

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 send_before". The item still ends expired when the window closes, and that is the lease running out — the normal end, not a failure.

A position asking for more than 131,000 energy_units requires 3600 or more here, and the default will not do: the volume arrives in pieces whose leases start at their own delegations, seconds apart. The order is refused as a whole — one such position is enough — with 400 invalid_request and details.reason = bulk_needs_longer_lease.

Default: 300. Example: 300.

client_refstring or nulloptional

Your identifier for reconciliation

Maximum length: 128.

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.

HeaderTypeDescription
Locationstring

The order's own URL — /v1/orders/{order_id}. Poll it, or use it as the link you store next to your invoice.

Retry-Afterinteger

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
    }
  }
}

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

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"
    }
  }
}

409

Idempotency conflict

Content type application/json.

Schema: Error.

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.

HeaderTypeDescription
Retry-Afterinteger

Seconds to wait before retrying.

RateLimit-Limitinteger

Requests per minute in this bucket — per UTC day on POST /sandbox/deposit, the one allowance in this API that is not counted per minute. Absent in exactly three cases, and in none is a number invented for it: the limiter could not read the bucket state (the request is let through then), the answer is too_many_auth_failures, which is counted by the authorization-failure counter and not by a bucket — see "Repeated authorization failures" — or it is the volume allowance (details.reason = bulk_volume_cap), which is energy per hour rather than requests per minute.

RateLimit-Remaininginteger

Requests left in this bucket right now.

RateLimit-Resetinteger

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

NameInRequiredTypeDescription
statusqueryoptionalOrderStatus
client_refqueryoptionalstring
cursorqueryoptionalstring
limitqueryoptionalinteger

Default: 50. Minimum: 1. Maximum: 200.

Responses

200

OK

Content type application/json.

FieldTypeRequiredDescription
dataarray of Orderrequired
next_cursorstring or nullrequired

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

GET /orders/{order_id}

Get an order

Authentication: Required — an API key in Authorization: Bearer … (authentication).

Parameters

NameInRequiredTypeDescription
order_idpathrequiredstring

Responses

200

OK

Content type application/json.

Schema: Order.

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

404

Not found

Content type application/json.

Schema: Error.

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

NameInRequiredTypeDescription
order_idpathrequiredstring

Responses

200

Order canceled, hold released

Content type application/json.

Schema: Order.

409

The order can no longer be canceled

Content type application/json.

Schema: Error.

404

Not found

Content type application/json.

Schema: Error.