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 you upfront. Each cycle is billed at the moment its energy is delegated: the first delegation of an activation costs 4 TRX, every next one costs 2 or 4 TRX depending on the energy your previous transfer actually consumed (≤65,000 → 2 TRX, more → 4 TRX). See Host Mode → Cycles and Pricing for the full rules, including the 8 TRX daily minimum (effective 2026-08-29).
  • The amount in the response is an estimate (cycles × reference price), not the final total.
  • Your balance is checked before the order is accepted; if it cannot cover the order, the order is rejected (error -2).

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, and each delegation is charged when it happens.

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 for {d['amount']} TRX")
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 for ${d.amount} TRX`);
    } 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 order total, in TRX (reference only — billing is per delegation)
data.statusstring"active" after a successful order
data.timestampstringISO timestamp of the order

Error Responses

codemsgCause
-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
-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"
}

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.