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
{
"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 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
amountfield 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 Status — total_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
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
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
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)
{
"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 cost in TRX (cycles × public price). Nothing is charged at this point — see Pricing and billing |
| data.status | string | "active" after a successful order |
| data.timestamp | string | ISO timestamp of the order |
Error Responses
| code | msg | Cause |
|---|---|---|
| -1 | API key required in X-API-KEY header or request body | No API key provided |
| -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 |
| -1 | Internal server error | Unexpected error — retry or contact support |
| -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) |
{
"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:
| HTTP | Body | Cause |
|---|---|---|
| 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 |
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.