Skip to content

POST /apiv2/order5m

Create a 5-minute energy rental order through Netts internal energy pools.

Endpoint URL

POST https://netts.io/apiv2/order5m

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-API-KEYYesYour API key from Netts dashboard
X-Real-IPYesIP address from your whitelist

Request Body

json
{
    "amount": 65000,
    "receiveAddress": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
}

Parameters

ParameterTypeRequiredDescription
amountintegerYesEnergy amount to rent (minimum: 61,000, maximum: 650,000)
receiveAddressstringYesTRON address that will receive the energy (TRC-20 format)

Energy Limits

The 5-minute endpoint accepts energy amounts between 61,000 and 650,000 units per order. Requests outside this range will be rejected with HTTP 400.

Provider Information

5-minute energy orders are fulfilled exclusively through Netts internal energy pools. Unlike the 1-hour endpoint, external providers are not used.

Availability & Retry Strategy

Since delegations come only from internal pools, temporary unavailability is possible during high-demand periods. If you receive a 503 error, retry the request after a short delay or fall back to the 1-hour endpoint which has access to multiple external providers.

Example Requests

cURL

bash
curl -X POST https://netts.io/apiv2/order5m \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -H "X-Real-IP: your_whitelisted_ip" \
  -d '{
    "amount": 65000,
    "receiveAddress": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
  }'

Python

python
import requests

url = "https://netts.io/apiv2/order5m"
headers = {
    "Content-Type": "application/json",
    "X-API-KEY": "your_api_key",
    "X-Real-IP": "your_whitelisted_ip"
}

payload = {
    "amount": 65000,
    "receiveAddress": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
}

response = requests.post(url, headers=headers, json=payload)
data = response.json()

if response.status_code == 200:
    detail = data.get('detail', {})
    order_data = detail.get('data', {})
    print(f"Order ID: {order_data.get('orderId')}")
    print(f"Transaction Hash: {order_data.get('hash')}")
    print(f"Energy Delivered: {order_data.get('energy')}")
    print(f"Cost: {order_data.get('paidTRX')} TRX")
    print(f"Delegate Address: {order_data.get('delegateAddress')}")
elif response.status_code == 503:
    # Pool temporarily unavailable - retry or fallback to 1h
    print("Pool busy, retrying in 2 seconds...")
else:
    error_detail = data.get('detail', data)
    print(f"Error Code: {error_detail.get('code', 'N/A')}")
    print(f"Error Message: {error_detail.get('msg', error_detail)}")

Response

Success Response (200 OK)

json
{
    "detail": {
        "code": 10000,
        "msg": "Successful, 1.430 TRX deducted",
        "data": {
            "orderId": "5Mb4ee11ef86",
            "paidTRX": 1.43,
            "hash": "3636f97dde244fca17cdc0b2cf7fd157...",
            "delegateAddress": "TNp5gsJhBmZFXgCdgjMgr8pEZ8fHgXUHDq",
            "energy": 65050
        }
    }
}

Success with Address Activation (200 OK)

When the receiver address has not been activated on the TRON network, Netts activates it automatically. The activation cost is added to the total:

json
{
    "detail": {
        "code": 10000,
        "msg": "Successful, 1.430 TRX for energy + 1.100 TRX for address activation",
        "data": {
            "orderId": "5Mb4ee11ef86",
            "paidTRX": 2.53,
            "hash": "3636f97dde244fca17cdc0b2cf7fd157...",
            "delegateAddress": "TNp5gsJhBmZFXgCdgjMgr8pEZ8fHgXUHDq",
            "energy": 65050,
            "activationHash": "bab38070a64b237acc9110ecf5135acc..."
        }
    }
}

Response Fields

FieldTypeDescription
detail.codeintegerAlways 10000 for successful orders
detail.msgstringSuccess message with deducted amount
detail.data.orderIdstringUnified order ID (format: 5M{id})
detail.data.paidTRXnumberTotal cost in TRX (includes activation fee if applicable)
detail.data.hashstringDelegation transaction hash
detail.data.delegateAddressstringPool address that delegated energy
detail.data.energyintegerEnergy amount + buffer (typically +50)
detail.data.activationHashstringOnly present if address activation was performed

Error Responses

Invalid Energy Amount (400)

json
{
    "code": 1003,
    "msg": "Energy amount must be between 61000 and 650000. Requested: 50000"
}

Authentication Error (401)

json
{
    "detail": "Invalid API key or IP not in whitelist"
}

Insufficient Balance (403)

json
{
    "code": 1004,
    "msg": "Insufficient funds. Required: 1.43 TRX, Available: 0.50 TRX"
}

Service Unavailable (503)

json
{
    "code": 5003,
    "msg": "Service temporarily unavailable. Energy delegation failed after retries."
}

Handling 503 Errors

A 503 response means internal pools are temporarily at capacity. Recommended strategy:

  1. Wait 2-3 seconds and retry the 5-minute order
  2. If still unavailable, fall back to the 1-hour endpoint which uses multiple providers

Internal Server Error (500)

json
{
    "code": 5000,
    "msg": "Internal server error occurred"
}

Error Code Reference

CodeDescriptionHTTP Status
10000Success200
10000Success (cached response)208
-Duplicate request still processing409
1003Energy amount out of range400
1004Insufficient balance403
1005User payer address not configured400
5000Internal server error500
5003Energy service unavailable503

Rate Limits

The following rate limits apply to this endpoint (per IP address):

PeriodLimitDescription
1 second50 requestsMaximum 50 requests per second

Rate Limit Headers

http
RateLimit-Limit: 50
RateLimit-Remaining: 49
RateLimit-Reset: 1
X-RateLimit-Limit-Second: 50
X-RateLimit-Remaining-Second: 49

Rate Limit Exceeded (429)

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

Idempotency

The API supports idempotency to prevent duplicate order processing. When you send multiple identical requests, the system ensures the order is processed only once.

How Idempotency Works

Request uniqueness is determined by a combination of:

  • Request timestamp (2-second window)
  • Energy amount
  • Receiver address
  • API key

Each request is given a 2-second uniqueness window. Requests with identical parameters within this window are treated as duplicates.

Supplying Your Own Key

You can take idempotency into your own hands by sending the X-Idempotency-Key header. When it is present, that value alone decides whether a request is a repeat, and the automatic combination above is not used. When it is absent, nothing changes — the server derives the key for you.

The rules are the same as on /apiv2/order1h:

HeaderX-Idempotency-Key
FormatExactly 64 lowercase hexadecimal characters — a SHA-256 digest
Lifetime24 hours from the first request carrying that key
ScopeYour account. The same value sent by a different account never returns your result

A key of any other shape — a UUID with dashes, base64, uppercase hex — is rejected with 400 before the order is placed and before anything is charged:

json
{
    "detail": "Invalid idempotency key format. Must be 64-character hexadecimal string."
}

Derive the key from your API key so it is unique to your account and reproducible on a retry — the worked example is on the 1-hour page. Include the rental period in the message you hash: renting the same address for 5 minutes and for 1 hour are different orders, and reusing one key for both returns the first order's response for the second request.

Placing Two Identical Orders

The same trap as on the hourly endpoint, with a wider window. Two identical orders — the same amount to the same address — are indistinguishable from a retry, and only the moment of arrival separates them.

Without a key of your own:

Gap between the two requestsWhat happens
Inside the same 2-second windowThe second request is taken for a repeat. It is not executed: you get 208 and the first order's response. Nothing is charged for it
More than two seconds apartTwo different keys — both orders are placed and both are charged

So leave more than two seconds between two identical orders, and read the status code: 208 means the order you just sent was not placed.

A pause is a workaround, not a fix — it also separates the requests you never meant to repeat, such as a retry after a timeout or a message redelivered by your queue, and each of those becomes a separate order with a separate charge. Sending your own key is what actually settles it: a new nonce for a new order, the first attempt's nonce for a retry. The reasoning in full is on the 1-hour page.

HTTP Status Codes for Duplicate Requests

Status CodeNameDescription
200OKOrder processed successfully (first request)
208Already ReportedOrder was already processed, returning cached response
409ConflictRequest is currently being processed, do not retry

Duplicate Request - Already Processed (208)

json
{
    "detail": {
        "code": 10000,
        "msg": "Successful, 1.430 TRX deducted",
        "data": {
            "hash": "3636f97dde244fca17cdc0b2cf7fd157...",
            "energy": 65050,
            "orderId": "5Mb4ee11ef86",
            "paidTRX": 1.43,
            "delegateAddress": "TNp5gsJhBmZFXgCdgjMgr8pEZ8fHgXUHDq"
        }
    },
    "idempotency": {
        "status": "completed",
        "cached": true,
        "original_created_at": "2026-03-21T08:53:52.498000"
    }
}

Duplicate Request - Still Processing (409)

json
{
    "success": false,
    "error": "duplicate_request_processing",
    "message": "This request is currently being processed. Please wait and do not retry.",
    "retry_after_seconds": 3
}

Best Practices

  • Do not send parallel requests with the same parameters - wait for each response
  • Handle 409 responses by waiting, not by immediately retrying
  • Check idempotency.cached field to identify cached responses

Comparison: 5-Minute vs 1-Hour Orders

Feature5-Minute Order1-Hour Order
Endpoint/apiv2/order5m/apiv2/order1h
Duration5 minutes1 hour
Energy range61,000 - 650,00061,000 - 3,000,000
ProvidersNetts internal pools onlyInternal pools + external providers
PriceLower (5-minute rate)Standard hourly rate
AvailabilityMay be limited during peakHigh (multiple provider fallback)
Best forFrequent small transactionsLarge or guaranteed delivery

Notes

  • Energy is delivered instantly upon successful order (typically within 0.5-2 seconds)
  • API response timeout: Maximum 10 seconds (includes internal retry attempts)
  • Address activation: If receiver address is not activated, Netts activates it at cost price. Activation cost is charged only once per address
  • Duration: Fixed 5 minutes (300 seconds)
  • Minimum energy amount: 61,000 units
  • Maximum energy amount: 650,000 units per order
  • Energy buffer: +50 units added automatically (free of charge)
  • Order ID format: 5M{id} for unified tracking
  • Pricing: Dynamic based on time of day via Pricing API
  • Rate limiting: 50 requests per second per IP address
  • Internal pools only: If pools are at capacity, retry after a short delay or use the 1-hour endpoint as fallback