nrg.market API reference Interactive reference

Schemas

Every named object of the contract. Endpoint pages link here wherever a field or a body is one of these.

TRX

Amount in TRX, 6 decimal places

Type: string.

Pattern: ^\d+\.\d{6}$. Example: 2.080000.

USD

A US dollar figure, 6 decimal places — the same shape as TRX and for the same reason. It appears in one place only, as the reference rate trx_usd of GET /tariff; we hold no balances in USD and charge nothing in USD.

Type: string.

Pattern: ^\d+\.\d{6}$. Example: 0.337700.

TronAddress

Type: string.

Pattern: ^T[1-9A-HJ-NP-Za-km-z]{33}$. Example: TN3W4H6rK2ce4vX9YnFQHwKENnHjoxb3m9.

TransferKind

Determined automatically and finalized when the order is created: single — the recipient already holds USDT (~65,000 energy); double — the recipient's USDT balance is zero, whether or not the address is activated on chain (~131,000): what doubles the figure is the empty balance, not a missing account — an unactivated address that already holds USDT is single, and an activated one with a zero balance is double; custom — the recipient is a contract, the amount is calculated from actual usage.

Three values and no more. This is what an address check answers about a transfer, and a transfer is one of these three shapes; the volume a mode c position may name instead (bulk) is not a finding about any address, so it lives in ItemKind and never appears here. A client switching on this enum keeps its three branches.

Type: string.

One of: single, double, custom.

ItemKind

What an order item was sold as — the three transfer kinds (TransferKind, with the same meanings) plus one that is not a transfer kind at all:

bulk — a mode c position that named energy_units instead of kind. There is no transfer behind it and therefore no standard to derive the volume from: the number is the client's, and energy_units carries it. Such a position may be filled from several sources at once, which is why it is the only kind whose energy_delivered can come back below what was ordered.

bulk occurs on items only. GET /address-check and the estimate's per-transfer items answer with TransferKind and cannot produce it.

Type: string.

One of: single, double, custom, bulk.

EnergyKind

The volume you are buying in mode c, where no recipient is named and there is therefore nothing to read it from: single — about 65,000 energy, enough for a transfer to an address that already holds USDT; double — about 131,000, enough for one that does not.

custom is absent on purpose. It is the outcome of a dry-run against a specific contract recipient, so it cannot be asked for in advance — an order to a contract goes through mode a.

A position that wants some other volume does not use this enum at all: it names energy_units instead of kind.

Type: string.

One of: single, double.

OrderStatus

ready occurs when every live item is delegated — the energy confirmed on chain — and send_before is computed. While one is still pending, the order stays in purchasing; an item that has already failed does not hold the rest back.

In mode B the order stays ready while we broadcast. broadcasting and broadcasted are states of a transaction in flight, not resting places: broadcasted means a node accepted the transaction, not that it is in a block. An order whose items are all broadcasted is therefore still ready, and it becomes final only when each of them reaches confirmed (or expired / failed) — which is also when the money is settled. A mode B completed order can hold expired items: the energy was delivered and your transaction failed on its own (see ItemError); whether a transfer went out is the item's confirmed, not the order's status. Any item outside the two groups below (pending, delegated, broadcasting, broadcasted) means the order is not final yet and leaves its status where it is.

An order is fulfilled when the energy has been delivered, not when we see the transfer: in mode A you send the transaction yourself, and the order status does not depend on it. Charging happens at the same moment; the rule is unchanged: we charge for energy provided.

The final status is determined by the mix of item statuses:

  • energy delivered for all (ready/sent/expired/confirmed) → completed;
  • some delivered, some failed → partially_completed;
  • all failed → failed.

expired remains in the enum for history: in mode A an order becomes final before the send window expires.

awaiting_funds — mode b only, and only with auto_topup enabled. Your prepaid balance did not cover the order, but the signed transaction is already ours, so instead of a 402 the order is parked: no hold is placed, a top-up request goes out (topup.requested), and fund_before is the deadline for the deposit to be credited. Pay it in time and the order becomes funded at the price quoted in this very response — a price recomputed before your deposit lands does not change it; from there it is filled like any order, raise included (see "Order price" in the introduction). Miss it and the order goes failed with error_code = funding_window_missed: no money moved at either end, and the signed transaction is free to be submitted in a new order.

Type: string.

One of: created, awaiting_funds, funded, purchasing, ready, completed, partially_completed, expired, failed, canceled.

LedgerRow

One row of the money history. GET /ledger returns a page of these, and POST /sandbox/deposit answers with the single row it wrote — deliberately the same schema, so that one parser reads both and a sandbox rehearsal exercises the type an integration will meet in production. What a sandbox row narrows (type is always deposit, txid always the sandbox-<uuid> form) is said at that endpoint, in prose and examples: narrowing it here would give the two responses two shapes and put the divergence back.

FieldTypeRequiredDescription
idstringrequired
typestringrequired

One of: deposit, hold, hold_release, charge, refund, adjustment_credit, adjustment_debit.

amount_trxTRXrequired

Absolute amount; direction is defined by type

balance_after_trxTRXrequired

Full balance after the operation. Unchanged for hold and hold_release — a hold affects available_trx.

order_idstring or nullrequired
queue_session_idstring or nullrequired

The queue session this movement belongs to (api-spec.md §12.6): its hold, the charge for each delivered packet and the hold_release of the remainder carry it, and none of them has an order_id — a session buys without an order. null on every other row.

txidstring or nullrequired
created_atstring (date-time)required

ItemStatus

pending — the item is accepted, energy not yet delivered; delegated — the energy is confirmed on-chain at the from address (a provider's response alone does not grant this status); ready — the energy is delivered and send_before is known; for mode A this is the obligation fulfilled, and the order becomes completed at this point; sent — the outgoing transaction has been seen in the network (informational: affects neither money nor order status); broadcasting/broadcasted — mode B, the transaction is being sent / has been accepted by the network; confirmed — mode B, after solidification (~1 min); expired — mode A: you did not send the transfer before send_before; the energy was delivered, so it is charged and does not spoil fulfillment. Mode B: the energy was delivered and your own transaction then failed — the node refused it for what it is (error: broadcast_failed), or it was mined and the contract refused it or it ran out of energy having spent less than the transfer's requirement (error: transaction_reverted); charged, and the signed transaction stays used; failed — the service was not delivered through our fault; no charge, the hold is returned. This also covers a mode B item we failed to send before send_before (error: broadcast_window_missed): past the promised deadline we do not broadcast, and we do not charge for what was not sent — a mode B broadcast no node took for reasons of its own (error: broadcast_failed), and a mode B transfer mined and run out of energy where the shortfall is shown to be ours (error: transaction_reverted; the signed transaction is in a block and stays used).

Type: string.

One of: pending, delegated, ready, sent, broadcasting, broadcasted, confirmed, expired, failed.

ItemError

The reason on a failed item — a closed list — and, in mode B, on an expired one. null for the other statuses; an expired item of modes A and C has no reason (it is not a failure but unused energy, and it is charged).

purchase_failed — the energy could not be purchased. It also covers a market dearer than the position's price whose raise could not be made — your available balance was short of the difference, or the price would have gone above the cap (see "Order price" in the introduction); on a bulk position, only while nothing has been bought for it and allow_partial is off — later such a fill ends short instead. On a bulk position it also covers "the market could not cover the whole volume": a position that did not allow a partial fill and could not be completed is a purchase that did not happen, and it is refused the same way and refunded the same way; broadcast_failed — mode B, the node rejected the transaction. On a failed item no node took it for reasons of its own (none answered, busy, no peers, any code not listed next) and the hold is returned — TRANSACTION_EXPIRATION_ERROR among them: a deadline past the node's horizon is refused at acceptance, so after delivery it means the node's clock and ours disagree. On an expired item the node refused the transaction itself after the energy was delivered — TAPOS_ERROR, SIGERROR, BANDWITH_ERROR, CONTRACT_VALIDATE_ERROR — and the item is charged; transaction_reverted — mode B, the transaction made it into a block and did not execute. On an expired item it is charged: the contract refused the transfer (a REVERT — the USDT left the wallet after the order, the wallet was blacklisted — or an OUT_OF_TIME, the call past the network's execution time), or the call ran out of energy (OUT_OF_ENERGY) having spent less than the transfer's requirement — 64,285 units for a single, 130,285 for a double, the dry run's measurement for a custom — so the energy we delivered was not on the address when it ran. On a failed item the call ran out of energy and the shortfall is shown to be ours: it spent at least the requirement and still ran out (our estimate was short — a recipient balance emptied after the dry run that doubled the cost), or our records show the vendor revoked the delegation before your transfer's block, or another of your transfers from the same address — in this order or another — took its energy: your transfers from that address whose energy was on it at the block together spent at least what they together required; the hold is returned. Either way the transaction is in a block, and the same signed bytes are not accepted again; broadcast_window_missed — mode B, we did not send it before send_before; window_closed_before_send — the window closed on an item that never reached ready; this is an inconsistency on our side, the money is returned; funding_window_missed — mode B, the order was awaiting_funds and the deposit was not credited before fund_before. Nothing was ever held for it and nothing was bought, so there is no refund to make; the signed transaction is released and may go into a new order.

On a failed item none of these is ever charged for. The first five return the hold in full; funding_window_missed has nothing to return — there was none. The two mode B reasons on an expired item are the exception, and the only one: the energy was delivered and your own transaction failed, so the item's price is charged.

Type: string or null.

One of: purchase_failed, broadcast_failed, transaction_reverted, broadcast_window_missed, window_closed_before_send, funding_window_missed.

OrderErrorCode

The reason on a failed order — the same values as on items (ItemError), plus multiple_causes when items failed for different reasons. null for the other statuses.

transaction_reverted is the reason of a mode b order whose transfers ran out of energy where the shortfall was shown to be ours, and were refunded. A transaction the contract refused is charged and closes its item expired, which sets no order reason.

Type: string or null.

One of: purchase_failed, broadcast_failed, transaction_reverted, broadcast_window_missed, window_closed_before_send, funding_window_missed, multiple_causes.

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

Energy for a wallet, with no transfer named. You say which wallet and how much; there is no recipient, and so no transaction for us to see or to broadcast.

This is the mode for when the recipient is not known yet, or when you are topping a wallet up ahead of a batch you will assemble later. Because there is no recipient, the volume cannot be derived and you state it yourself — as kind, which also means we cannot correct it (single on a transfer that turns out to need double leaves the transfer short of energy, and the difference burns TRX), or as energy_units, a number of your own.

A position names one of the two, never both and never neither. kind is the transfer-shaped volume, energy_units is a volume you chose; sending both is 400 invalid_request with details.reason = kind_and_energy_units, because the two would have to be reconciled and there is no rule that says which wins.

Items of such an order carry to: null and never reach sent: there is no transfer for us to match. They stand at ready for the send_before window and become expired when it closes, which here means the lease ran out — the normal end, not a failure.

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.

OrderItem

FieldTypeRequiredDescription
idstringrequired
fromTronAddressrequired
toTronAddress or nullrequired

null in mode c: the order named a wallet to energise and no recipient.

kindItemKindrequired
energy_unitsintegerrequired

The volume ordered, in units, and the basis of price_trx: the price is this number times the position's per-unit price — set when the order was created (the current price, or on a bulk position our cost floor for the volume where that was higher, see energy_units in the POST /orders request) and raised at fulfillment only by the rule in "Order price" in the introduction. What arrives does not move it.

energy_deliveredinteger or nullrequired

The energy confirmed on chain for this position, in units.

null until it is confirmed, and null for good on a position that named a kind rather than a volume: there the delivery requirement is the transfer's cost, not a number the client chose, and it is met or the position fails (§2.2 of the API spec).

On a bulk position it is the number the charge is counted from, where the position recorded one. Equal to energy_units on a full fill; below it when the fill ended short — either because the position allowed a short one from the start (allow_partial: true), or because the market moved after the buying had begun and what was already delegated to your wallet could not be taken back. Either way the charge is at most energy_delivered at the same per-unit price (lower only under a private arrangement), the rest of the hold is released, and the order ends partially_completed. A position that closed with this still null — the lease ran out before a reading of the chain succeeded — is charged for what was bought for it, capped at energy_units. The charge itself, whichever way it was counted, is on the order as charged_trx.

A measurement within half a percent of energy_units is reported as energy_units exactly. Suppliers hand over slightly under a round figure and the reading is taken between blocks, so a delivery you got in full lands a few hundred units short of the order. Reporting that as a shortfall would bill you short, refund the difference and close the order partially_completed over a measurement error. Below that band the number is the measurement itself.

Never above energy_units, and that is a cap rather than an observation. What lands on the wallet can be more than you ordered — a supplier rounds a piece up to its product's size, and anyone at all may delegate to your wallet while we are filling — so the measurement can exceed the order, and this field is the measurement cut down to what you asked for. The extra energy is on the wallet and yours to spend: it is never billed, and a position that got more than it ordered is a full fill, not a different kind of one.

price_trxTRXrequired
statusItemStatusrequired
txidstring or nullrequired
errorItemErrorrequired

Order

FieldTypeRequiredDescription
idstringrequired

Example: ord_9c1f2a.

modestringrequired

One of: a, b, c.

statusOrderStatusrequired
duration_sintegerrequired

The lease this order was sold as, in seconds — the value you sent or the default that stood in for it. Always present, on every order however old: an order created before the field existed was a five-minute one and says so.

Read it rather than remembering what you asked for. It is the product the price was taken from and the term send_before was counted off, and it is fixed at creation: a product switched off afterwards does not change an order already sold.

Example: 300.

total_trxTRXrequired

The price of the order now — the amount the hold stands at. It is quoted_total_trx unless a position was raised to the market at fulfillment (see "Order price" in the introduction): each raise adds the difference here, held from your balance and announced by order.repriced, and a volume raise taken back lowers it again, never below quoted_total_trx. A position that fails after a raise is refunded whole, the raise included, and total_trx keeps the raised figure. What the order finally cost is charged_trx.

quoted_total_trxTRXrequired

The order's total at creation — the amount the hold was placed for. It never changes. Equal to total_trx unless a position was raised to the market at fulfillment; the difference between the two is what the raises added.

charged_trxTRX or nullrequired

What the order actually cost once it settled — the amount taken from the hold. null while the order is open: the hold stands at total_trx and nothing has been charged yet.

On completed it equals total_trx, raises included. On partially_completed it is below it: a volume position (kind: bulk) is charged for the units that were delivered, at the per-unit price the position stands at when the order settles — energy_delivered on the position shows those units where the position recorded them — and a position that failed in a batch is not charged at all; the difference came back to your balance as a hold_release. On failed and canceled it is 0.000000: nothing was charged; a hold, where one had been placed, was released whole; an order that was parked in awaiting_funds never had one, so its ledger shows neither a charge nor a hold_release.

The same figure the closing order.completed, order.partially_completed and order.failed events carry as charged_trx, and the amount of the charge entry this order left in GET /ledger (no such entry is written for a zero).

burn_cost_trxTRXrequired

Informational — what the transfer would have cost by burning TRX. Locked at order creation using the network's burn price in effect and never recalculated: it is the base for the savings in GET /stats/savings.

send_beforestring (date-time) or nullrequired

Appears with the ready status. Send the transaction before this moment. Counted from the last confirmed delegation in the order, so in a batch the deadline is shared by all items, and bounded by the order's first successful purchase: energy cannot start before it was bought, and the promise can only be as long as the oldest energy in the order allows. That bound applies to every position — in a batch the first transfer's energy is bought before the last one's, so a batch's window can be shorter than the lease less the margin. A volume position (kind: bulk) is the same rule over its chunks: its energy arrives over an interval, and the earliest delivered chunk is the purchase that bounds the window.

The window is duration_s less a 3-second safety margin — 297 seconds on the five-minute product, 3597 on the hourly one, 86 397 on the daily one. The 3 seconds are the same on every product, and they are arithmetic rather than slack: they make the window end before the lease does and nothing more. The gap between the delegation we saw confirmed and the lease the network actually started — a block, plus the cycle on which we poll for it — is normally wider than that margin, so on most orders this deadline falls after the energy on the address is already gone. That is the ordinary case, not an edge one: treat the last seconds of the window as unavailable, because a transfer sent there burns your TRX at full price and the charge is not refunded. Send on ready, not on the deadline.

In mode b it is never later than the expiry of the signed transaction itself, less a margin for the broadcast — a node refuses an expired transaction whatever energy sits on the address — and in a batch that means the soonest expiry among the items. Read the field rather than assuming the full window: a transaction sent to us with little life left gets a short one.

fund_beforestring (date-time) or nullrequired

Present only while the status is awaiting_funds (and after it, as the record of that wait). The deposit has to be credited by this moment — not merely sent — for the order to be funded; a TRON deposit is credited after three confirmations.

It is the sooner of two deadlines: ten minutes from acceptance, and the expiry of your own signed transaction less the margin the purchase and delegation need. A transaction with little life left therefore gets a short window, and one with too little to be worth parking is refused with the ordinary 402 instead. Read the field rather than assuming ten minutes.

client_refstring or nullrequired
itemsarray of OrderItemrequired
error_codeOrderErrorCoderequired
created_atstring (date-time)required
updated_atstring (date-time)required

ProductTariff

One lease on sale and its price now. Products are priced independently against the market — a day is not five minutes times 288 — so every field here is about this duration_s and nothing in it can be derived from another entry.

The price unit is the one used everywhere else in this contract: sun per unit of energy for the whole lease. A one-day product at 110 sun/unit costs 110 sun per unit for the whole day, not per hour; nothing here is a rate to be multiplied by time.

FieldTypeRequiredDescription
duration_sintegerrequired

The lease in seconds — the value to send as duration_s in POST /orders and POST /estimate. One of 300, 3600, 86400.

Example: 3600.

current_price_sunintegerrequired

What one unit of energy costs on this product right now, in sun, for the whole lease. This is the number an order of this duration is priced at if it is created now.

Example: 23.

custombooleanrequired

true — for this product your agreed price is in force now; false — the public price. Per product: prices may be agreed for one lease and not for another. Only a request with a key can see true.

Example: false.

typical_price_trxobjectrequired

Approximate price of a single transfer on this lease

typical_price_trx.singleTRXrequired
typical_price_trx.doubleTRXrequired

Settings

FieldTypeRequiredDescription
baseline_price_suninteger or nullrequired

Your current price per unit of energy with another provider — for savings statistics

Example: 40.

balance_low_threshold_trxTRXrequired

Threshold for the balance.low event

auto_topupAutoTopuprequired

AutoTopup

Whether — and how much — we should ask you to top up. Always present, enabled: false with zeroes for an account that has never set it.

With it off, a 402 is exactly the 402 it always was and nothing is written to GET /topup-requests. With it on, a refused order raises a top-up request and sends topup.requested; so does a balance under balance_low_threshold_trx, provided there is a target_trx to fill to. How much is asked for is under target_trx and min_trx below.

FieldTypeRequiredDescription
enabledbooleanrequired

Requires max_per_day_trx above zero. The rule is checked on the resulting settings, so an account that already has a cap may send enabled on its own.

target_trxTRXrequired

The balance a request tops you up to. A refused order asks for the shortfall plus min_trx, or for the fill up to this level, whichever is larger; a low balance asks for the fill alone, lifted to min_trx when the fill is smaller. A low balance at or above this level is not asked for anything.

"0.000000" — no target: a refused order then asks for the shortfall plus min_trx, and a low balance alone asks for nothing — there is no level to fill to, and min_trx is never asked for on its own, so no topup.requested goes out.

When both are set, this must be at least balance_low_threshold_trx, or PATCH /settings answers 400 invalid_request naming the field: between the two the balance would count as low and as already sufficient at once, and no request would be raised.

min_trxTRXrequired

Added on top of a shortfall, so paying a request does not leave you at zero and the next order refused again. On a low balance it is a floor rather than an addition: the fill up to target_trx is lifted to it when smaller, and it never raises a request by itself.

max_per_day_trxTRXrequired

The ceiling on everything requested within one UTC day. A request is clipped to what is left of it, and no request is made at all if the clipped amount would not cover the shortfall that prompted it — an amount that cannot unblock your order is worse than none. Cancelling a request gives its room back; letting one expire does not, because the money may still arrive.

AutoTopupPatch

An edit of the auto-top-up policy. Only the fields you send change; a null in any of them means "not sent", the same as leaving it out.

FieldTypeRequiredDescription
enabledboolean or nulloptional
target_trxTRX or nulloptional
min_trxTRX or nulloptional
max_per_day_trxTRX or nulloptional

TopupRequestStatus

open — we are waiting for the money; fulfilled — deposits since the request covered it (or your target_trx was reached by some other route); expired — nobody answered within a day; canceled — you withdrew it. Only open can be cancelled.

Type: string.

One of: open, fulfilled, expired, canceled.

TopupRequestReason

order_insufficient_balance — an order was refused just now and is waiting on this deposit; balance_low — nothing has failed yet, the available balance simply fell under your threshold.

This can change on a request you have already seen. It escalates one way, balance_low → order_insufficient_balance, when an order is refused while the request is open, and the escalation re-sends topup.requested even if amount_trx did not move.

Type: string.

One of: order_insufficient_balance, balance_low.

TopupRequest

FieldTypeRequiredDescription
idstringrequired
statusTopupRequestStatusrequired
reasonTopupRequestReasonrequired
amount_trxTRXrequired

How much to send. Raised, never lowered, while the request is open: a further shortfall replaces this with the larger figure and re-sends topup.requested with the same id. It can also stay the same across a re-send — see reason, which escalates on its own.

deposit_addressTronAddressrequired

Where to send it — your deposit address as of the moment the request was made, not a live lookup. It is the address the webhook named, and it stays the same for the life of the request.

order_idstring or nullrequired

The order waiting on this money, when there is one. null for a balance_low request — and null for a refused order too: the order was not created, which is what the refusal means.

expires_atstring (date-time)required
fulfilled_atstring (date-time) or nullrequired
fulfilled_txidstring or nullrequired

The transaction whose credit closed the request — the last one counted, not the whole story: several transfers may add up to one request.

created_atstring (date-time)required
updated_atstring (date-time)required

MaintenanceRuleStatus

paused — the rule neither spends nor tops up. Set by you (PATCH) or by the system when the balance cannot cover the daily hold (paused_reason: insufficient_balance). Resumed only by an explicit PATCH.

Type: string.

One of: active, paused.

MaintenanceRuleCreate

FieldTypeRequiredDescription
addressTronAddressrequired

The wallet on which energy is maintained

daily_budget_trxTRXrequired

The rule's spending cap per UTC day. Mandatory. Reserved from the available balance like an order hold; the remainder is released at the day boundary.

No less than the maintenance_price_trx.double rate from GET /tariff — the rule's first top-up is charged at that rate and would not fit into a smaller budget — and no more than 1,000,000 TRX.

MaintenanceRulePatch

FieldTypeRequiredDescription
statusMaintenanceRuleStatus or nulloptional
daily_budget_trxTRX or nulloptional

MaintenanceRule

FieldTypeRequiredDescription
idstringrequired

Example: mnt_4b7d1c.

addressTronAddressrequired
daily_budget_trxTRXrequired
statusMaintenanceRuleStatusrequired
paused_reasonstring or nullrequired

Set when the rule was stopped by the system: the available balance could not cover a new daily hold. A pause set by you has no reason (null) — this difference shows whether the rule is waiting for a deposit or for your decision.

Always insufficient_balance.

spent_today_trxTRXrequired

Charged against the daily budget during the current UTC day

last_topup_atstring (date-time) or nullrequired
created_atstring (date-time)required
updated_atstring (date-time)required

AddressBookEntryCreate

FieldTypeRequiredDescription
addressTronAddressrequired
namestringrequired

Trimmed of surrounding spaces; 1–64 characters after that.

Minimum length: 1. Maximum length: 64.

notestring or nulloptional

Empty or blank is stored as null.

Maximum length: 280.

tagsarray of stringoptional

Up to ten distinct tags. Each is trimmed and must then be 1–32 characters with no comma, |, carriage return or line feed. Compared by Unicode case folding: a tag repeated in another case keeps its first spelling, and a tag your book already uses is stored in the book's spelling. The ten are counted after that collapse; the array itself may carry at most 50 items. Order is kept. Omitted, the entry has none.

Maximum items: 50. Each item — Minimum length: 1. Maximum length: 32.

AddressBookEntryUpdate

FieldTypeRequiredDescription
namestringoptional

Minimum length: 1. Maximum length: 64.

notestring or nulloptional

Maximum length: 280.

tagsarray of stringoptional

Replaces the whole array. Same rules as on creation: up to ten distinct tags, at most 50 items as sent.

Maximum items: 50. Each item — Minimum length: 1. Maximum length: 32.

AddressBookEntry

FieldTypeRequiredDescription
idstringrequired
addressTronAddressrequired
namestringrequired
notestring or nullrequired
tagsarray of stringrequired
created_atstring (date-time)required
updated_atstring (date-time)required
usageobjectrequired

What this account did with the address, computed when you read it from the account's own history and nobody else's. Keyed by the address, not by the entry: an address deleted and saved again shows the same numbers.

usage.orders_as_senderintegerrequired

Order items of this account sent from the address (from).

usage.orders_as_recipientintegerrequired

Order items of this account sent to the address (to).

usage.last_used_atstring (date-time) or nullrequired

The latest creation time among this account's order items (either side), queue sessions (sender), queue items (recipient) and auto-refill rules on the address. null — never used.

usage.auto_refill_rule_idstring or nullrequired

This account's live (active or paused) auto-refill rule on the address.

usage.queue_session_idstring or nullrequired

This account's live (created, running or paused) queue session on the address.

chainobject or nullrequired

GET /address-check for the address, minus address. Present only on a list read with include=chain that reached the network; null otherwise — see chain_unavailable on the page.

chain.activatedbooleanrequired
chain.holds_usdtbooleanrequired
chain.blacklistedbooleanrequired
chain.is_contractbooleanrequired
chain.expected_kindTransferKindrequired

AddressBookImport

FieldTypeRequiredDescription
entriesarray of AddressBookEntryCreaterequired

Each row has the shape of AddressBookEntryCreate, but is judged on its own: a row that breaks it is an error in the result, not a refusal of the body. Only a row that is not an object refuses the body.

Minimum items: 1. Maximum items: 500.

AddressBookImportResult

FieldTypeRequiredDescription
resultsarray of objectrequired

One per row of the body, in body order.

results[].indexintegerrequired

The row's position in entries, from 0.

results[].statusstringrequired

One of: created, exists, error.

results[].idstring or nullrequired

created — the new entry; exists — the entry already saved for the address; error — null.

results[].reasonstring or nullrequired

Set only when status is error.

One of: invalid_address, invalid_name, invalid_note, invalid_tags, duplicate_in_request, entries_limit_reached, tags_limit_reached.

createdintegerrequired
existsintegerrequired
errorsintegerrequired

AddressBookSuggestion

FieldTypeRequiredDescription
addressTronAddressrequired
orders_as_senderintegerrequired

Order items of this account sent from the address.

orders_as_recipientintegerrequired

Order items of this account sent to the address.

last_used_atstring (date-time)required

The latest creation time among this account's order items, queue sessions, queue items and auto-refill rules on the address.

AddressBookTag

FieldTypeRequiredDescription
tagstringrequired

The tag as the book spells it.

countintegerrequired

Entries carrying the tag.

AddressBookTagRename

FieldTypeRequiredDescription
fromstringrequired

Minimum length: 1. Maximum length: 32.

tostringrequired

Minimum length: 1. Maximum length: 32.

AddressBookTagDelete

FieldTypeRequiredDescription
tagstringrequired

Minimum length: 1. Maximum length: 32.

AddressBookBulkTags

At least one of add and remove must name a tag.

FieldTypeRequiredDescription
idsarray of string (uuid)required

Entry ids; a repeated id counts once.

Minimum items: 1. Maximum items: 500.

addarray of stringoptional

Tags to put on every listed entry, after remove. At most ten items as sent.

Maximum items: 10. Each item — Minimum length: 1. Maximum length: 32.

removearray of stringoptional

Tags to take off every listed entry, before add. At most ten items as sent.

Maximum items: 10. Each item — Minimum length: 1. Maximum length: 32.

AddressBookUpdated

FieldTypeRequiredDescription
updatedintegerrequired

Entries actually changed.

AddressBookBulkDelete

FieldTypeRequiredDescription
idsarray of string (uuid)required

Entry ids; a repeated id counts once, and one that is not an entry of your book is skipped.

Minimum items: 1. Maximum items: 500.

AddressBookDeleted

FieldTypeRequiredDescription
deletedintegerrequired

Entries this call deleted.

USDTAmount

A USDT amount as a decimal string — no float, like TRX. Up to six fractional digits are accepted on input ("120.5", "1000"); responses always carry six ("120.500000").

Type: string.

Pattern: ^\d+(\.\d{1,6})?$.

QueueSessionStatus

created — the queue is recorded, nothing is reserved or bought yet; running — buying; paused — not buying until the cause clears, which it does by itself (see QueueSessionReason); completed — the queue was exhausted and the last delivered packet has expired; stopped — you stopped it. The last two are final.

Type: string.

One of: created, running, paused, completed, stopped.

QueueSessionReason

Why the session is in its current status — the reason of the last transition. Pauses: insufficient_balance — the wallet's USDT balance is below the next transfer's amount; hold_exhausted — the available balance could not cover even the next packet, at the price that packet is sold at (which can be above the tariff, see queue.packet_delivered); the session resumes by itself once a deposit covers the difference; service_paused — the service is not accepting orders right now. Each pause lifts itself when its cause clears: balance_restored, hold_restored, service_resumed. queue_exhausted closes a session as completed; client_stop closes it as stopped; client_start is a running session that has not paused yet.

Type: string.

One of: client_start, client_stop, insufficient_balance, hold_exhausted, service_paused, balance_restored, hold_restored, service_resumed, queue_exhausted.

QueueItemStatus

pending — waiting for your transfer; sent — your transfer to this recipient was seen on-chain; skipped — this item was at the head of the queue and was not seen sent within the skip window, so the queue moved past it. A skipped item is not re-queued.

Type: string.

One of: pending, sent, skipped.

QueueItemReason

transfer_seen goes with sent, not_sent_in_time with skipped; null while the item is pending.

Type: string.

One of: transfer_seen, not_sent_in_time.

QueueItemInput

FieldTypeRequiredDescription
toTronAddressrequired

The recipient of the USDT transfer

amount_usdtUSDTAmountrequired

The amount you are going to send. It is what the session checks the wallet's USDT balance against before buying energy for this item, and what matches your transfer to the item when several items name the same recipient.

QueueSessionCreate

FieldTypeRequiredDescription
fromTronAddressrequired

The sender wallet. Must be activated, must not be a contract and must not be on the USDT blacklist. One live session per wallet.

target_unitsintegeroptional

The level of free energy to keep on the wallet, in energy units. A floor, not a purchase size: the session never holds more energy than the next transfers in the queue need. Not below 65 000 — what one transfer to an address that already holds USDT costs: a target under that is a level no transfer can leave from, and it is refused rather than rounded up. The default and the ceiling are the service's settings (api-spec.md §12.8); above the ceiling — 400 invalid_request with details.max_units.

Default: 1000000. Minimum: 65000.

itemsarray of QueueItemInputoptional

The first transfers of the queue, in sending order. May be empty. Not together with expected_transfers.

Maximum items: 500.

expected_transfersinteger or nulloptional

A session without a list: how many transfers are coming, and nothing about them. Every outgoing USDT transfer of the wallet after Start counts as one; the level is sized by what a transfer of this wallet has been costing (its recent history — a transfer to an empty address until there is any); the USDT-balance pause does not apply, and items cannot be appended — create another session for more. One of items and expected_transfers, never both (400 invalid_request, details.reason = items_or_expected_transfers); at most the per-session ceiling (400 invalid_request, details.reason = expected_transfers_out_of_range with min and max).

Minimum: 1.

QueueItemsAppend

FieldTypeRequiredDescription
itemsarray of QueueItemInputrequired

Minimum items: 1. Maximum items: 500.

QueueItemsAppended

FieldTypeRequiredDescription
addedintegerrequired

How many items this request appended

items_totalintegerrequired

Items in the session after the append

items_pendingintegerrequired

Items still waiting to be sent — the remaining-payments counter

QueueNextItem

FieldTypeRequiredDescription
seqintegerrequired
toTronAddressrequired
amount_usdtUSDTAmountrequired
kindTransferKind or nullrequired

The transfer kind of the recipient as last checked; null until checked

need_unitsinteger or nullrequired

Energy the transfer needs by its kind — the single or double norm; null until checked, and for custom, whose dry-run measurement is taken on the keeper's pass and not stored on the item

QueueCounters

The session's counters. items_pending is the remaining-payments counter; packets_confirmed counts every packet whose delivery was seen on-chain, including those whose lease has since ended; units_delivered and charged_trx sum those packets.

FieldTypeRequiredDescription
items_totalintegerrequired
items_pendingintegerrequired
items_sentintegerrequired
items_skippedintegerrequired
packets_boughtintegerrequired
packets_confirmedintegerrequired
units_deliveredintegerrequired
charged_trxTRXrequired

QueueSession

Every field of QueueCounters, and the fields below.

FieldTypeRequiredDescription
idstringrequired
fromTronAddressrequired
target_unitsintegerrequired
expected_transfersinteger or nullrequired

The count a session without a list was created with; null on a session with a list. On a count-only session items_total is this number, items_sent counts every outgoing USDT transfer since Start, items_pending is what is left, and next_item is always null.

statusQueueSessionStatusrequired
reasonQueueSessionReason or nullrequired

The reason of the last status transition; null on a created session

hold_trxTRXrequired

What is currently reserved on your balance for this session — the remainder of its hold. "0.000000" before Start and once the session has settled.

free_energy_unitsinteger or nullrequired

Free energy on the wallet at the last uncached reading; null before the first

free_energy_atstring (date-time) or nullrequired
usdt_balanceUSDTAmount or nullrequired

The wallet's USDT balance at the last reading; null before the first

usdt_balance_atstring (date-time) or nullrequired
next_itemQueueNextItem or nullrequired

The head of the queue — the next transfer we expect; null when nothing is pending

created_atstring (date-time)required
started_atstring (date-time) or nullrequired
stopped_atstring (date-time) or nullrequired

When buying ended — set on completed and on stopped alike

updated_atstring (date-time)required

QueueItem

FieldTypeRequiredDescription
seqintegerrequired

1-based position in the queue, in append order

toTronAddressrequired
amount_usdtUSDTAmountrequired
kindTransferKind or nullrequired

The recipient's transfer kind as last checked — re-read while the item is within the sizing window, because a recipient's USDT balance can change between append and send; null until checked.

statusQueueItemStatusrequired
reasonQueueItemReason or nullrequired
sent_txidstring or nullrequired

The transfer we matched to this item; null unless sent

sent_atstring (date-time) or nullrequired

QueueStartedData

FieldTypeRequiredDescription
session_idstringrequired
fromTronAddressrequired
target_unitsintegerrequired
hold_trxTRXrequired
countersQueueCountersrequired

QueuePacketDeliveredData

One packet, confirmed on-chain and charged. units is what was bought, price_sun the price per unit the packet was sold at (an integer, like current_price_sun in GET /tariff), charged_trx their product — this packet's charge; the session's running totals are in counters.

price_sun is the five-minute tariff price of the moment of purchase, or above it when the vendor that sold the packet cost more than the tariff leaves our minimum margin under — then the lowest whole-sun price that covers that cost with the margin (see POST /queue-sessions). Read the charge from here, not from GET /tariff.

FieldTypeRequiredDescription
session_idstringrequired
packet_idstringrequired
unitsintegerrequired
price_sunintegerrequired
charged_trxTRXrequired
hold_trxTRXrequired

The hold's remainder after this charge

countersQueueCountersrequired

QueuePausedData

FieldTypeRequiredDescription
session_idstringrequired
reasonQueueSessionReasonrequired

insufficient_balance, hold_exhausted or service_paused

countersQueueCountersrequired

QueueResumedData

FieldTypeRequiredDescription
session_idstringrequired
reasonQueueSessionReasonrequired

balance_restored, hold_restored or service_resumed

countersQueueCountersrequired

QueueCompletedData

FieldTypeRequiredDescription
session_idstringrequired
reasonQueueSessionReasonrequired

queue_exhausted

hold_trxTRXrequired

"0.000000": the hold is released on completion

countersQueueCountersrequired

Final — nothing is bought or charged after this event

QueueStoppedData

FieldTypeRequiredDescription
session_idstringrequired
reasonQueueSessionReasonrequired

client_stop

hold_trxTRXrequired

The hold's remainder at the moment of the stop. Not necessarily zero: packets bought just before the stop are still settled, each with its own queue.packet_delivered, and the remainder is released after the last of them.

countersQueueCountersrequired

As of the stop; packets settled afterwards add to them

WebhookEvent

topup.* and maintenance.topup are close in name and are not the same thing. maintenance.topup is energy delivered to a wallet under an auto-refill rule (§10); topup.requested / topup.fulfilled / topup.expired are about TRX we asked you to send to your deposit address. Money actually credited stays deposit.credited.

deposit.credited is sent for a deposit of 1 TRX or more. A smaller one — a wallet probing the address, change, the tail of a test — is credited without it: the balance moves and the deposit row is in GET /ledger, but no deposit.credited is sent, to a webhook or anywhere else. Exactly 1 TRX is announced. The events about the request and the balance are not muted: if such a deposit completes an open top-up request, topup.fulfilled still arrives, carrying its txid, and balance.low still fires if the balance stays under your threshold. An integration that keeps its own books to the last sun reconciles against GET /balance and GET /ledger?type=deposit, not against the events.

queue.* is the life of a queue session (api-spec.md §12.10, the queueLifecycle entry under webhooks:), in the order a session goes through them.

order.repriced is an order's price raised to the market at fulfillment, or a volume raise taken back (the orderRepriced entry under webhooks:, and "Order price" in the introduction). It is not a closing event: the order goes on.

Type: string.

One of: order.ready, order.item.sent, order.item.expired, order.completed, order.partially_completed, order.failed, order.repriced, deposit.credited, balance.low, topup.requested, topup.fulfilled, topup.expired, maintenance.topup, maintenance.budget_exhausted, maintenance.paused, queue.started, queue.packet_delivered, queue.paused, queue.resumed, queue.completed, queue.stopped.

DeliveredWebhookEvent

What can stand in a delivery-log row: every subscribable event plus webhook.test, the probe from POST /webhooks/{id}/test. The probe is deliberately absent from WebhookEvent — it cannot be subscribed to — but it is delivered through the same queue and shows up in the same log.

Type: string.

One of: order.ready, order.item.sent, order.item.expired, order.completed, order.partially_completed, order.failed, order.repriced, deposit.credited, balance.low, topup.requested, topup.fulfilled, topup.expired, maintenance.topup, maintenance.budget_exhausted, maintenance.paused, queue.started, queue.packet_delivered, queue.paused, queue.resumed, queue.completed, queue.stopped, webhook.test.

WebhookEndpoint

FieldTypeRequiredDescription
idstringrequired
urlstring (uri)required
eventsarray of WebhookEventrequired
statusstringrequired

disabled — we have stopped delivering here. It is set automatically after a run of failures (see the retry policy under webhooks below) and cannot be undone through the API: register a new endpoint, which issues a new signing secret, or write to support and ask us to switch this one back on.

One of: active, disabled.

disabled_atstring (date-time) or nullrequired

When we stopped delivering here. null — we never did. Read it together with status: on its own the status cannot tell a receiver that fell off ten minutes ago from one that fell off three weeks ago, and those are different conversations.

disabled_reasonstring or nullrequired

Why we stopped, null when we did not. Three values occur: too_many_failures — too many deliveries used up all five attempts within 24 hours; target_not_public — the URL stopped resolving to a public address, and we do not send requests into private networks; url_unusable — no request can be built from the address at all, because it holds an ASCII control character. Registration has refused such an address since 2026-08-30, so url_unusable belongs to endpoints registered before that; it is terminal in the same way — waiting changes nothing about the string, so nothing is retried. A disabled endpoint with null here was switched off before we started recording the cause. Treat the set as open: match on the values you know and fall back to the text.

created_atstring (date-time)required

WebhookDelivery

FieldTypeRequiredDescription
idstringrequired
eventDeliveredWebhookEventrequired
event_idstring (uuid)required

The same value the receiver saw in the body and header

statusstringrequired

One of: pending, delivered, failed.

attemptsintegerrequired

Attempts made so far. A replay resets it to zero, so the row can read attempts: 0 after having been tried five times.

response_statusinteger or nullrequired

What the receiver answered with. null — there was no answer at all (timeout, DNS, dropped connection); a separate fact, not a zero.

last_errorstring or nullrequired
last_attempt_atstring (date-time) or nullrequired
failed_attemptsinteger or nullrequired

How many attempts this delivery lost, over its whole life. The four fields above describe the last attempt only, so on a delivery that finally went through they describe the attempt that worked — this is what says whether it went through first time or after three refusals. It is not attempts minus one: a replay puts attempts back to zero and leaves this count alone, so after a replay the two deliberately differ. null — a row from before we started counting.

last_failure_atstring (date-time) or nullrequired

When the most recent failed attempt was. null — none of them failed.

last_failure_statusinteger or nullrequired

What the receiver answered on that attempt. null — it did not answer at all (timeout, DNS, dropped connection), the same distinction response_status makes. Read it together with last_failure_at: no moment there means nothing failed.

last_failure_errorstring or nullrequired

What that failure was — HTTP 500, Timeout: no answer within 5s, dns: …. Present whenever last_failure_at is.

next_retry_atstring (date-time) or nullrequired

When the next attempt is due. null — none is: the delivery either succeeded or ran out of attempts.

created_atstring (date-time)required

When the event was queued, not when it was last tried

WebhookTestResult

FieldTypeRequiredDescription
delivery_idstringrequired

The row this probe left in the delivery log

event_idstring (uuid)required
eventstringrequired

Always webhook.test.

deliveredbooleanrequired

Whether the receiver answered 2xx

response_statusinteger or nullrequired
errorstring or nullrequired

What got in the way. null — nothing did.

WebhookPayload

FieldTypeRequiredDescription
eventDeliveredWebhookEventoptional
event_idstring (uuid)optional

Deduplication key, stable across every retry of this event — automatic ones and replays requested through POST /webhooks/{id}/deliveries/{delivery_id}/retry alike. Two requests carrying one event_id are one event; process the first and drop the rest.

It is inside the signed body on purpose, and mirrored in the X-NRG-Event-Id header only for convenience: a deduplication key that travelled outside the signature could be altered in transit, and a receiver dropping duplicates by it would drop a real event.

sent_atstring (date-time)optional
dataobjectoptional

Fields beyond these are allowed.

Error

FieldTypeRequiredDescription
errorobjectoptional
error.codestringoptional

invalid_request — the request body or parameters failed validation; invalid_address — the address is not a valid Tron address (400), or it is well-formed but cannot be used for what you asked — an unactivated wallet, a contract — in which case details.reason says which (422); unauthorized — the key is missing, invalid, or the request came from an IP outside the allowlist; not_found — the entity does not exist (the same code if it belongs to another client); rate_limited — too many requests: your key is fine, the pace is not. Wait Retry-After seconds; too_many_auth_failures — too many refused authorizations from this credential. Waiting will not fix it: check the key and its IP allowlist.

This is the field to branch on. message is prose for a human reading a log, it is written in English, and it may be reworded at any time.

One of: invalid_request, invalid_address, unauthorized, blacklisted_recipient, insufficient_balance, capacity_unavailable, order_not_cancelable, topup_request_not_cancelable, idempotency_conflict, maintenance_rule_conflict, queue_session_active, queue_session_closed, wallet_busy, address_book_conflict, not_found, rate_limited, too_many_auth_failures, internal_error.

error.messagestringoptional

Human-readable explanation, in English. Not for parsing — everything a program needs is in code and details.

Example: Key not accepted.

error.detailsobjectoptional

Machine-readable specifics, shaped by code. Empty object when there is nothing to add.

Fields beyond these are allowed.

error.details.errorsarray of FieldErroroptional

Which fields failed validation, and why. Present on invalid_request and invalid_address whenever the request was rejected by schema validation — the most frequently parsed error body in this API.

FieldError

One failed field inside details.errors.

FieldTypeRequiredDescription
fieldstringrequired

Where the value came from and what it is called, joined by dots: the first segment is the part of the request (body, query, path, header), the rest is the path to the value inside it. Nested and indexed values keep their whole path (body.transfers.0.to).

Example: query.range, body.transfers.0.to.

messagestringrequired

What is wrong with this value, in English.

Example: Input should be '24h', '7d' or '30d'.

typestringrequired

The validation rule that rejected it — Pydantic's error type, passed through unchanged. Stable enough to branch on for the common cases (missing, int_parsing, literal_error, string_too_long), and invalid_address for our own address check. Treat an unfamiliar value as "invalid".

Example: literal_error, missing, invalid_address.