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/orderAuthentication
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
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | API key (or X-API-KEY header). |
| address | string | Yes | TRON (TRC-20) address, ^T[1-9A-HJ-NP-Za-km-z]{33}$. |
| cycles | integer | Yes | Number 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
amountin 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
| Field | Type | Description |
|---|---|---|
| code | integer | 0 = success, negative = error |
| msg | string | Human-readable message |
| data.order_id | integer | Internal order identifier |
| data.address | string | The address the cycles were bought for |
| data.cycles | integer | Number of cycles purchased |
| data.amount | number | Estimated order total, in TRX (reference only — billing is per delegation) |
| data.status | string | "active" after a successful order |
| data.timestamp | string | ISO timestamp of the order |
Error Responses
| code | msg | Cause |
|---|---|---|
| -1 | Invalid API key or IP not in whitelist | Authentication failed |
| -1 | Invalid TRC-20 address format | Bad address format |
| -1 | Cycle count must be 1 or more | cycles < 1 |
| -1 | Database error processing order | Temporary server-side error — retry |
| -2 | Insufficient balance. Required: X TRX, Available: Y TRX | Balance below order total |
| -6 | Cannot buy cycles: There is an open order with … cycles for this address | An open order already exists (including infinity) |
json
{
"code": -2,
"msg": "Insufficient balance. Required: 23.5 TRX, Available: 10.0 TRX"
}Related Endpoints
- POST /apiv2/time/add — add the address first
- POST /apiv2/time/infinitystart — unlimited cycles instead of a fixed count
- POST /apiv2/time/status — check remaining cycles
- POST /apiv2/time/stop — stop and close the order
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.