What each energy order status says about your transfer and your money
Whether we took your money shows on an energy order, in its status and in charged_trx. Whether your USDT transfer went shows on its items, one for each transfer or wallet you named. The order becomes completed once energy has been delivered for every item, and an item counts as delivered when its status is ready, sent, expired or confirmed. A completed order can therefore hold an item whose transfer never left the wallet, and that item is charged.
The path of an order
An order that goes well passes through five statuses: created, funded, purchasing, ready, completed. The order reaches ready when every item that has not failed is delegated, and at that moment the order gains send_before, the deadline for sending.
The order enum also carries expired, which our API reference keeps for history.
| Order status | What it means | charged_trx | The hold |
|---|---|---|---|
created, funded, purchasing, ready | The order is open | null | Stands at total_trx |
awaiting_funds | Mode B, waiting for your deposit until fund_before | null | None placed |
completed | Energy delivered for every item | Equal to total_trx, raises included | Taken in full |
partially_completed | Some items failed through our fault, or a volume item was filled short | Below total_trx: delivered items only, and a volume item by the units it received | The rest returned as a hold_release |
failed | Every item failed through our fault; or the order waited in awaiting_funds and the deposit was not credited in time | Zero | Returned whole, where one was placed |
canceled | You canceled before the purchase began | Zero | Returned whole, where one was placed |
Completed means the energy arrived
We charge for energy provided, when the order closes as completed or partially_completed. In mode A the order does not wait for your transfer: completed follows ready at once, and the order.item.sent webhook comes after order.completed, once your transfer appears on the network.
Item statuses, and whether the transfer went
Every item starts at pending and becomes delegated when its energy is confirmed on chain at the from address. In modes A and C it then becomes ready when send_before is known, and a mode C item, with to: null, stays ready until the window closes. A mode B item never shows ready: it goes from delegated through broadcasting, while we send the transaction, and broadcasted, once a node has accepted it, to confirmed after solidification. The transaction may already be in a block while the item still shows broadcasted: on a big batch our verdict on a mined transfer can take several minutes. A mode B order stays ready meanwhile and settles the money when every item has reached confirmed, expired or failed (how the three modes work).
sent in mode A means we saw your transfer on the network, with its hash in data.txid of order.item.sent. Whether it succeeded is the result the chain wrote beside that hash (what OUT_OF_ENERGY means). confirmed in mode B means your transaction is in a solidified block and executed, since one that reached a block and did not execute closes with transaction_reverted. expired is charged in all three modes: in mode A no transfer of yours appeared before send_before (what happens when the window closes), in mode B your transaction was refused or did not execute after the energy arrived, and in mode C the window ended, because mode C tracks no transfer. A failed item costs nothing, whatever its reason.
Expired in mode B carries a reason
In modes A and C an expired item has null in error: the energy was delivered, and then the window closed (how long rented energy lasts). In mode B every expired item names broadcast_failed or transaction_reverted. We delegate the energy before we broadcast. When a node then refuses your transaction because of a defect in the transaction itself, or the contract refuses it in its block, or the transaction runs out of energy having spent less than its requirement, we charge the item at its price and send the order.item.expired webhook. A new order carrying the same signed bytes is refused with 400. A mode B failed item is refunded whole, and its transaction can go into a new order unless the reason is transaction_reverted, which means the transaction is already in a block.
The closed list of refusal reasons
A failed item names its reason in error, except the items of a canceled order, and a failed order names one in error_code. The two fields share six values, and error_code has a seventh, multiple_causes. The list is closed and changes only with our API specification. Of the seven, only broadcast_failed and transaction_reverted ever come with a charge, and only on an expired item.
| Reason | What happened | Money |
|---|---|---|
purchase_failed | We could not buy the energy, including when the market was dearer than the item's price and the raise was beyond your available balance or the cap. On a volume item, a raise that cannot be made ends it this way only while nothing has been bought for it and allow_partial is off; after the first piece is bought, the fill ends short. | Hold returned in full |
broadcast_failed | Mode B: a node did not take your transaction | On failed, returned: no node answered, the node was busy, or it refused with a code other than the four named next. On expired, charged: after the energy arrived the node refused the transaction because of a defect in the transaction itself, with TAPOS_ERROR, SIGERROR, BANDWITH_ERROR or CONTRACT_VALIDATE_ERROR. |
transaction_reverted | Mode B: the transaction reached a block and did not execute | On expired, charged: the contract refused the transfer, or the transfer ran out of energy having spent less than its requirement. On failed, returned: the shortfall is shown to be ours, for example the transfer spent at least its requirement and still ran out, or the vendor revoked the delegation before your transfer's block. |
broadcast_window_missed | Mode B: we did not send your transaction before send_before | Hold returned in full |
window_closed_before_send | The window closed on an item that never reached ready, an inconsistency on our side | Hold returned in full |
funding_window_missed | Mode B: the order waited in awaiting_funds and your deposit was not credited before fund_before | Nothing to return: no hold was placed |
multiple_causes | Only in error_code: the items failed for different reasons | Read each item |
The requirement is 64,285 units of energy for a single transfer, 130,285 for a double, and our dry run's measurement for a custom one. An order carries error_code only when it is failed, and a failed item is never charged, so an order whose error_code is transaction_reverted was refunded; a transfer the contract refused closes its item as expired and puts no reason on the order.
awaiting_funds and its deadline
An order parks in awaiting_funds only in mode B and only with auto_topup switched on. When your balance does not cover such an order, we already hold your signed transaction, so the order is accepted with 202 in place of 402 insufficient_balance. We place no hold and send a topup.requested event, and the order gains fund_before, the moment by which your deposit has to be credited. A deposit is credited after three confirmations, so sending it by fund_before is not enough.
fund_before is whichever comes first: ten minutes after we accepted the order, or the expiry of your signed transaction less the time the purchase and the delegation need. When that deadline is less than a minute away, the order is refused with the ordinary 402. A deposit credited in time moves the order to funded at the price quoted in the 202. A deposit that misses the deadline leaves the order failed with funding_window_missed: no money moved, and your signed transaction is free for a new order.
Cancelling, and when it is too late
POST /v1/orders/{order_id}/cancel works only before the purchase starts, while the order is created, funded or awaiting_funds. The order becomes canceled with charged_trx at zero, and any hold comes back whole. Its items close as failed with null in error, and a mode B transaction in them is free at once for a new order. Cancelling a parked order also withdraws the top-up request, unless another parked order of yours is waiting on the same request. Once the order has reached purchasing, the call answers 409 order_not_cancelable.
The fields that say what you paid
What you were charged is charged_trx on the order: null while the order is open, final once it closes, and the same figure as in the closing order.completed, order.partially_completed or order.failed event and in the charge entry of GET /v1/ledger, written only for a charge above zero. total_trx is where the hold stands while the order is open, and quoted_total_trx is the total at creation, which never changes. The two differ only after an item's price was raised at fulfillment, which order.repriced announces. An item that fails after a raise is refunded whole, the raise with it, while total_trx keeps the raised figure, so only charged_trx says what the order cost.
A volume item, ordered by energy_units and returned with kind: bulk, is the one kind that can be filled short. Its energy_delivered holds the units confirmed on chain, never more than were ordered. When that number is below energy_units, the charge counts from it at no more than the item's price per unit, the rest of the hold comes back, and the order ends partially_completed.
These rules are read from our API reference and client documentation as they stood when we wrote this; we have not counted how often each status or reason occurs on live orders.
Look up any order of yours and read its items and charged_trx with one call: GET /v1/orders/{order_id} in the API reference →