Skip to content

Order energy for 1 hour​

POST
/order1h

Hourly energy rental. The order goes through several providers with automatic failover: the cheapest available one is picked, and if it declines the order moves to the next.

Energy normally arrives in 0.5–10 seconds. The response timeout is 10 seconds. If the receiver address is not activated on TRON, NETTS activates it at cost price and the response may take up to 6 seconds.

A buffer of +50 energy units is added to the order automatically, free of charge, as compensation to the provider.

Idempotency. By default the request is identified by the combination of the timestamp (a 1-second window), the amount, the receiver address and the API key. 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 response, or 409 if the first one is still running. 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-Real-IP*

An IP address from the key's whitelist. A request from an address outside the whitelist is rejected with 401.

Type
string
Required
Example"203.0.113.10"
Format
"ipv4"
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": "1H123456",
  
  
  
"paidTRX": 2.23,
  
  
  
"hash": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef12345678",
  
  
  
"delegateAddress": "TNp5gsJhBmZFXgCdgjMgr8pEZ8fHgXUHDq",
  
  
  
"energy": 131050
  
  
}
  
}
}

Playground​

Authorization
Headers
Body

Samples​

Powered by VitePress OpenAPI