Skip to content

POST /apiv2/bandwidth/daily ​

Rent TRON bandwidth for 24 hours and delegate it to a recipient address. The bandwidth is reclaimed automatically when the 24 hours end.

⚠️ Available on request only. Daily rental is enabled for an account by Netts support. Without it every request is rejected with 5009. Contact support to request access.

The limits of daily rental are set for your account when access is granted:

  • the minimum and maximum amount of one order;
  • the maximum amount on one recipient address;
  • the maximum amount on all your addresses together.

Only your active daily rentals count against these limits. Rentals made with POST /apiv2/bandwidth (5 minutes, 1 hour) do not.

Endpoint URL ​

POST https://netts.io/apiv2/bandwidth/daily

Request Headers ​

HeaderRequiredDescription
Content-TypeYesapplication/json
X-API-KEYYesYour API key from Netts dashboard
X-Idempotency-KeyNoOptional client-generated key (base64) to safely retry without double-ordering. If omitted, the server generates one automatically

Request Body ​

json
{
    "amount": 20000,
    "receiveAddress": "TXXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "reclaimOldest": false,
    "test": false
}

Parameters ​

ParameterTypeRequiredDescription
amountintegerYesBandwidth units to rent, within the per-order limits of your account
receiveAddressstringYesTRON address that will receive the bandwidth (T…, 34 chars, base58)
reclaimOldestbooleanNoWhat to do when the order would exceed your total limit. true — reclaim your oldest daily rental (on any address) first, then delegate the new one. false — reject the order with 5010. Default false
testbooleanNoDry run. Checks access, limits and balance and shows what would happen, without any on-chain action and without charging. Default false

The rental period is always 24 hours, so the body has no period field. Unknown fields are rejected with HTTP 422.

Limits ​

Per-address limit. If the new order would take the recipient address above your per-address limit, your oldest daily rental on that address is reclaimed in full first, and then the new order is delegated. This happens automatically; reclaimOldest is not needed for it.

Total limit. If the new order would take the sum of all your daily rentals above your total limit:

  • with reclaimOldest: true your oldest daily rental on any address is reclaimed in full first, and then the new order is delegated;
  • with reclaimOldest: false the order is rejected with 5010 and nothing changes.

Reclaimed rentals are listed in the reclaimed field of the response. If a reclaim does not complete, no new order is created and nothing is charged (5012).

The cost of a reclaimed rental is not refunded, the same as for a voluntary early reclaim.

Daily orders of one account are processed one at a time. While another of your daily orders is being processed, a new one may get 5013 — retry in a few seconds.

Example Requests ​

cURL ​

bash
API_KEY="your_api_key"
ADDR="TXXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
AMOUNT=20000
NONCE=$(uuidgen)   # one value per order; resend the same key on every retry

# X-Idempotency-Key = base64( HMAC-SHA256( API_KEY, "addr:amount:1d:nonce" ) )
IDEMP=$(printf '%s' "${ADDR}:${AMOUNT}:1d:${NONCE}" \
  | openssl dgst -sha256 -hmac "$API_KEY" -binary | base64)

curl -X POST https://netts.io/apiv2/bandwidth/daily \
  --max-time 120 \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -H "X-Idempotency-Key: $IDEMP" \
  -d "{\"amount\": $AMOUNT, \"receiveAddress\": \"$ADDR\"}"

Python ​

python
import uuid, hmac, hashlib, base64, requests

API_KEY = "your_api_key"
url = "https://netts.io/apiv2/bandwidth/daily"
payload = {
    "amount": 20000,
    "receiveAddress": "TXXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "reclaimOldest": False,
}

# X-Idempotency-Key = base64( HMAC-SHA256( API_KEY, "addr:amount:1d:nonce" ) )
# Generate ONCE per order and resend the same value on every retry.
nonce = str(uuid.uuid4())
message = f"{payload['receiveAddress']}:{payload['amount']}:1d:{nonce}"
idem_key = base64.b64encode(
    hmac.new(API_KEY.encode(), message.encode(), hashlib.sha256).digest()
).decode()

headers = {
    "Content-Type": "application/json",
    "X-API-KEY": API_KEY,
    "X-Idempotency-Key": idem_key,
}

response = requests.post(url, headers=headers, json=payload, timeout=120)
detail = response.json().get("detail", {})

if response.status_code == 200 and detail.get("status") == "completed":
    d = detail["data"]
    print(f"Order ID:  {d['orderId']}")
    print(f"Hashes:    {d['hash']}")
    print(f"Expires:   {d['expiresAt']}")
    print(f"Cost:      {d['paidTRX']} TRX")
    for r in d["reclaimed"]:
        print(f"Reclaimed: {r['orderId']} ({r['bandwidth']} units)")
else:
    print(f"Code: {detail.get('code')} | {detail.get('msg', detail)}")

Set the HTTP timeout to at least 120 seconds: when an older rental is reclaimed first, the response comes after both the reclaim and the new delegation are confirmed.

Response ​

The examples show the cost as <cost>: it is a number in TRX.

Success — bandwidth delegated (200 OK) ​

json
{
    "detail": {
        "code": 10000,
        "status": "completed",
        "msg": "Successful, <cost> TRX",
        "data": {
            "orderId": "B1D<key14>",
            "paidTRX": "<cost>",
            "fulfilledBy": "bandwidth",
            "hash": ["a1b2c3..."],
            "bandwidth": 20000,
            "period": "1d",
            "expiresAt": "2026-12-03T13:40:12.512340+00:00",
            "reclaimed": [
                { "orderId": "B1D<key14>", "bandwidth": 20000, "reclaimHash": ["d4e5f6..."] }
            ]
        }
    }
}

reclaimed is an empty array when nothing had to be reclaimed.

Test run (200 OK, only with test=true) ​

Nothing is reclaimed, nothing is delegated and nothing is charged. wouldReclaim lists the rentals that a real order would reclaim first. The other fields show your current daily rentals and limits.

json
{
    "detail": {
        "code": 10003,
        "status": "test",
        "msg": "Test run — no on-chain action, no charge",
        "data": {
            "orderId": "B1D<key14>",
            "testAction": "would_delegate",
            "wouldCostTRX": "<cost>",
            "paidTRX": 0,
            "bandwidth": 20000,
            "period": "1d",
            "wouldReclaim": [{ "orderId": "B1D<key14>", "bandwidth": 20000 }],
            "addressUnits": 40000,
            "maxUnitsPerAddress": 50000,
            "totalUnits": 60000,
            "maxUnitsTotal": 200000
        }
    }
}

Response Fields ​

FieldTypeDescription
detail.codeinteger10000 delegated, 10003 test run
detail.statusstringcompleted / test / failed
detail.data.orderIdstringOrder ID, format B1D… — use it for the status and reclaim endpoints
detail.data.paidTRXnumberAmount charged in TRX (0 in a test run)
detail.data.wouldCostTRXnumberAmount a real order would cost, in TRX (test run only)
detail.data.hasharrayDelegation transaction hashes
detail.data.bandwidthintegerBandwidth units delegated
detail.data.periodstringAlways 1d
detail.data.expiresAtstringWhen the rental ends, ISO 8601 in UTC
detail.data.reclaimedarrayYour earlier daily rentals reclaimed by this order: orderId, bandwidth, reclaimHash
detail.data.wouldReclaimarrayRentals a real order would reclaim (test run only)
detail.data.addressUnitsintegerYour active daily bandwidth on this address (test run only)
detail.data.maxUnitsPerAddressintegerYour per-address limit (test run only)
detail.data.totalUnitsintegerYour active daily bandwidth on all addresses (test run only)
detail.data.maxUnitsTotalintegerYour total limit (test run only)

Status and Early Reclaim ​

Daily orders use the same endpoints as other bandwidth orders:

  • GET https://netts.io/apiv2/bandwidth/status/{orderId} — order status;
  • POST https://netts.io/apiv2/bandwidth/reclaim/{orderId} — voluntary early reclaim. The rental charge is not refunded.

See POST /apiv2/bandwidth for the request and response formats.

Error Responses ​

Not Available for the Account (403) ​

json
{ "detail": { "code": 5009, "status": "failed", "msg": "Daily bandwidth rental is available on request. Contact support." } }

Amount Outside Your Limits (400) ​

json
{ "detail": { "code": 5004, "status": "failed", "msg": "amount out of range 1000..50000" } }

Total Limit Exceeded (400) ​

The data object shows your current daily rentals and limits.

json
{
    "detail": {
        "code": 5010,
        "status": "failed",
        "msg": "Total daily bandwidth limit exceeded. Send reclaimOldest=true to reclaim your oldest daily order first.",
        "data": { "addressUnits": 0, "maxUnitsPerAddress": 50000, "totalUnits": 200000, "maxUnitsTotal": 200000 }
    }
}

Another Order in Progress (409) ​

json
{ "detail": { "code": 5013, "status": "failed", "msg": "Another daily order of yours is being processed. Try again shortly." } }

Reclaim Did Not Complete (503) ​

No new order was created and nothing was charged. Retry shortly.

json
{
    "detail": {
        "code": 5012,
        "status": "failed",
        "msg": "Could not reclaim your oldest daily order. No new order was created; try again shortly.",
        "data": { "reclaimed": [], "notReclaimed": "B1D<key14>" }
    }
}

Temporarily Unavailable (503) ​

json
{ "detail": { "code": 5011, "status": "failed", "msg": "Daily bandwidth rental is temporarily unavailable. Try again later." } }
json
{ "detail": { "code": 5003, "status": "failed", "msg": "Bandwidth delegation failed", "data": { "orderId": "B1D<key14>", "reclaimed": [] } } }

Authentication (-1, -2), insufficient balance (1004), the 422 validation error and the 429 rate limit look the same as for POST /apiv2/bandwidth.

Error Code Reference ​

CodeDescriptionHTTP Status
10000Success — bandwidth delegated200
10003Test run — nothing reclaimed, delegated or charged (test=true)200
anyRepeat of an already processed request — the result of the first attempt, successful or not208
-Duplicate request still processing409
-1API key missing or unknown401
-2IP not in the key's whitelist401
1004Insufficient balance403
1005No payer address for user400
5004Amount outside your per-order limits, or malformed idempotency key400
5009Daily rental is not enabled for the account — available on request403
5010Total limit exceeded and reclaimOldest is false400
5013Another daily order of yours is being processed — retry shortly409
-Invalid or unknown request body field (validation)422
5011Daily rental is temporarily unavailable — try again later503
5012An older rental could not be reclaimed — no new order, nothing charged503
5003Bandwidth delegation failed, or the service is temporarily unavailable — nothing charged503

Rate Limits ​

PeriodLimitDescription
1 second10 requestsMaximum 10 requests per second per IP

Rate Limit Exceeded (429) ​

json
{ "message": "API rate limit exceeded" }

Idempotency ​

Works the same as for POST /apiv2/bandwidth, with 1d in place of the period: the message is receiveAddress:amount:1d:nonce.

  • A repeat with the same key returns the result of the first attempt with HTTP 208, successful or not. Nothing is reclaimed, delegated or charged again. To try again after a failure, send a new key.
  • 409 with duplicate_request_processing — the same request is still being processed; wait, do not retry yet.
  • A malformed key is rejected with HTTP 400 (5004). The key lives 24 hours and is scoped to your account.

Notes ​

  • Access: on request only, enabled by Netts support (5009 without it).
  • Period: 24 hours. The bandwidth is reclaimed automatically when it ends.
  • Limits: per order, per address and in total — set for your account. Only active daily rentals count.
  • Payment: charged in TRX from your account balance when the bandwidth is delegated. A rejected order, a failed order and a test run cost nothing.
  • No buffer: exactly the requested amount is delegated.
  • Order ID format: B1D….