Skip to content

Order energy for 1 hour​

POST
/order1h

Hourly energy rental. The order is fulfilled from the NETTS pool or from a partner provider; if one source cannot deliver, the next one is tried within the same request. The price does not depend on which source delivered the energy.

A response typically takes about 1 second, 99% of orders within 3 seconds. It can take longer when the order passes to the next source or the receiver address has to be activated. If the receiver address is not activated on TRON, NETTS activates it at cost price.

amount outside 61,000…3,131,000 is rejected with 503 and code 5004, a non-numeric amount with 400 and code 5004; both bodies are flat {code, msg} without detail.

Idempotency. By default the request is identified by the combination of the timestamp (a 1-second window), the amount, the receiver address, the API key and the client IP. Send the X-Idempotency-Key header to decide that yourself — see the parameter below. Repeating the same request does not charge you twice: you get 208 with the cached result of the first attempt — the order if it was placed, the error if it was not — or 409 if the first one is still running. A failed attempt is cached too: to try again, send a new key. Identical requests must not be sent in parallel. Note the flip side: two orders you genuinely want, identical and sent inside the same window, are taken for one — the second is not placed and returns the first one's response. Leave more than a second between them, or send your own key.

Authorizations​

ApiKeyAuth

API key from the dashboard. Some Host Mode endpoints also accept the key as an api_key field in the request body — this is stated in the schema of the particular operation.

Type
API Key (header: X-API-KEY)

Parameters​

Header Parameters

X-Idempotency-Key

Idempotency key you generate yourself: exactly 64 lowercase hexadecimal characters, i.e. a SHA-256 digest. Note that this differs from /withdraw and /bandwidth, which take a base64 key — code copied from those endpoints is rejected here with 400. Build it from your API key so the value is unique to your account and reproducible on a retry: hmac_sha256(api_key, "receiveAddress:amount:nonce").hexdigest(), where nonce stays the same across retries of one order and differs between orders. Generate it once per order and resend the same value on every retry. If the header is omitted, the server derives a key itself from the API key, the receiver address, the amount, a 1-second time window and the client IP. The key lives 24 hours and is scoped to your account: the same value sent by another account never returns your result, though it is refused with 409 until your key expires.

Type
string
Example"7e5a4f3b2c1d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f"
Pattern
"^[a-f0-9]{64}$"

Request Body​

application/json
JSON
{
  
"amount": 131000,
  
"receiveAddress": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
}

Responses​

The order was fulfilled and the energy delegated. Postpaid accounts: with test or freezePrice the answer is a price check (10010) or a quote (10011) instead.

application/json
JSON
{
  
"detail": {
  
  
"code": 10000,
  
  
"msg": "Successful, 2.23 TRX deducted",
  
  
"data": {
  
  
  
"orderId": "1Hd41f0a9c3e",
  
  
  
"paidTRX": 2.23,
  
  
  
"hash": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456",
  
  
  
"delegateAddress": "TNp5gsJhBmZFXgCdgjMgr8pEZ8fHgXUHDq",
  
  
  
"energy": 131000
  
  
}
  
}
}

Playground​

Authorization
Headers
Body

Samples​

Powered by VitePress OpenAPI