Skip to content

POST /apiv2/time/order

Buy a specific number of energy delegation cycles for an address and activate Host Mode for it.

Endpoint URL

POST https://netts.io/apiv2/time/order

Authentication

Provide your API key in the request body (api_key) or the X-API-KEY header. The request IP must be in the whitelist configured for your API key.

Request Body

json
{
    "api_key": "your_api_key",
    "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
    "cycles": 10
}

Parameters

ParameterTypeRequiredDescription
api_keystringYesAPI key (or X-API-KEY header).
addressstringYesTRON (TRC-20) address, ^T[1-9A-HJ-NP-Za-km-z]{33}$.
cyclesintegerYesNumber of cycles to buy. Must be ≥ 1.

Pricing and billing

Ordering cycles does not charge your balance. Nothing is deducted at this step — each cycle is billed at the moment its energy is actually delegated. The first charge therefore appears right after the mode is switched on, before your first USDT transfer.

  • Your balance is checked against the estimate before the order is accepted; if it is lower, the order is rejected.
  • The amount field in the response is that estimate (cycles × price from the public price table). It is not the final total and does not match what will really be charged.
  • The rate is not flat: the first two delegations after the mode is switched on are charged at a higher rate, and from the third onward the rate depends on how much energy your previous transfer actually consumed. Current rates are published in Pricing.

To see what was really charged, use Time Statustotal_spent per address and total_amount_spent for the account.

Placing an order sets the address to active and creates an open order for the requested number of cycles. The address then starts receiving energy delegations cycle by cycle.

Example Requests

cURL

bash
curl -X POST https://netts.io/apiv2/time/order \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY_HERE",
    "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
    "cycles": 10
  }'

Python

python
import requests

resp = requests.post(
    "https://netts.io/apiv2/time/order",
    json={
        "api_key": "YOUR_API_KEY_HERE",
        "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
        "cycles": 10,
    },
    timeout=30,
)
result = resp.json()

if result["code"] == 0:
    d = result["data"]
    print(f"Order {d['order_id']}: {d['cycles']} cycles, estimated {d['amount']} TRX "
          f"(charged per delegation, not now)")
else:
    print("Error:", result["msg"])

Node.js

javascript
const axios = require('axios');

axios.post('https://netts.io/apiv2/time/order', {
    api_key: 'YOUR_API_KEY_HERE',
    address: 'TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE',
    cycles: 10,
}).then(({ data: result }) => {
    if (result.code === 0) {
        const d = result.data;
        console.log(`Order ${d.order_id}: ${d.cycles} cycles, estimated ${d.amount} TRX (charged per delegation, not now)`);
    } else {
        console.error('Error:', result.msg);
    }
}).catch(err => console.error('Request failed:', err.response?.data || err.message));

Response

Success (200 OK)

json
{
    "code": 0,
    "msg": "Cycles purchased and host mode activated successfully",
    "data": {
        "order_id": 5426,
        "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
        "cycles": 10,
        "amount": 23.5,
        "status": "active",
        "timestamp": "2026-07-13T05:30:15.123456"
    }
}

Response Fields

FieldTypeDescription
codeinteger0 = success, negative = error
msgstringHuman-readable message
data.order_idintegerInternal order identifier
data.addressstringThe address the cycles were bought for
data.cyclesintegerNumber of cycles purchased
data.amountnumberEstimated cost in TRX (cycles × public price). Nothing is charged at this point — see Pricing and billing
data.statusstring"active" after a successful order
data.timestampstringISO timestamp of the order

Error Responses

codemsgCause
-1API key required in X-API-KEY header or request bodyNo API key provided
-1Invalid API key or IP not in whitelistAuthentication failed
-1Invalid TRC-20 address formatBad address format
-1Cycle count must be 1 or morecycles < 1
-1Database error processing orderTemporary server-side error — retry
-1Internal server errorUnexpected error — retry or contact support
-2Insufficient balance. Required: X TRX, Available: Y TRXBalance below order total
-6Cannot buy cycles: There is an open order with … cycles for this addressAn open order already exists (including infinity)
json
{
    "code": -2,
    "msg": "Insufficient balance. Required: 23.5 TRX, Available: 10.0 TRX",
    "data": null
}

HTTP status codes

Endpoint errors are returned with HTTP 200 and a negative code — check code, not the HTTP status. Error bodies always include "data": null.

Some errors are returned before the request reaches the endpoint. They use a non-200 status and a different body shape:

HTTPBodyCause
402{"detail": {"code": 1004, "msg": "Insufficient funds. Minimum balance is 4 TRX. Please top up your account."}}Account balance is too low
403{"detail": {"code": 1005, "msg": "API key is blocked. Contact support."}}The API key is blocked — contact support
422{"detail": [ … ]}Request body failed validation: a required field is missing or has the wrong type. Note there is no code field in this response

Notes

  • If the address is not yet in Host Mode, ordering also registers it and activates it.
  • Only one open order per address is allowed at a time.
  • Purchased cycles are consumed one per delegation; when they run out the address stops automatically.