POST /apiv2/order5m
Create a 5-minute energy rental order through Netts internal energy pools.
Endpoint URL
POST https://netts.io/apiv2/order5mRequest Headers
| Header | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
| X-API-KEY | Yes | Your API key from Netts dashboard |
| X-Real-IP | Yes | IP address from your whitelist |
Request Body
{
"amount": 65000,
"receiveAddress": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | integer | Yes | Energy amount to rent (minimum: 61,000, maximum: 650,000) |
| receiveAddress | string | Yes | TRON 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
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
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)
{
"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:
{
"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
| Field | Type | Description |
|---|---|---|
| detail.code | integer | Always 10000 for successful orders |
| detail.msg | string | Success message with deducted amount |
| detail.data.orderId | string | Unified order ID (format: 5M{id}) |
| detail.data.paidTRX | number | Total cost in TRX (includes activation fee if applicable) |
| detail.data.hash | string | Delegation transaction hash |
| detail.data.delegateAddress | string | Pool address that delegated energy |
| detail.data.energy | integer | Energy amount + buffer (typically +50) |
| detail.data.activationHash | string | Only present if address activation was performed |
Error Responses
Invalid Energy Amount (400)
{
"code": 1003,
"msg": "Energy amount must be between 61000 and 650000. Requested: 50000"
}Authentication Error (401)
{
"detail": "Invalid API key or IP not in whitelist"
}Insufficient Balance (403)
{
"code": 1004,
"msg": "Insufficient funds. Required: 1.43 TRX, Available: 0.50 TRX"
}Service Unavailable (503)
{
"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:
- Wait 2-3 seconds and retry the 5-minute order
- If still unavailable, fall back to the 1-hour endpoint which uses multiple providers
Internal Server Error (500)
{
"code": 5000,
"msg": "Internal server error occurred"
}Error Code Reference
| Code | Description | HTTP Status |
|---|---|---|
10000 | Success | 200 |
10000 | Success (cached response) | 208 |
- | Duplicate request still processing | 409 |
1003 | Energy amount out of range | 400 |
1004 | Insufficient balance | 403 |
1005 | User payer address not configured | 400 |
5000 | Internal server error | 500 |
5003 | Energy service unavailable | 503 |
Rate Limits
The following rate limits apply to this endpoint (per IP address):
| Period | Limit | Description |
|---|---|---|
| 1 second | 50 requests | Maximum 50 requests per second |
Rate Limit Headers
RateLimit-Limit: 50
RateLimit-Remaining: 49
RateLimit-Reset: 1
X-RateLimit-Limit-Second: 50
X-RateLimit-Remaining-Second: 49Rate Limit Exceeded (429)
{
"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.
HTTP Status Codes for Duplicate Requests
| Status Code | Name | Description |
|---|---|---|
| 200 | OK | Order processed successfully (first request) |
| 208 | Already Reported | Order was already processed, returning cached response |
| 409 | Conflict | Request is currently being processed, do not retry |
Duplicate Request - Already Processed (208)
{
"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)
{
"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.cachedfield to identify cached responses
Comparison: 5-Minute vs 1-Hour Orders
| Feature | 5-Minute Order | 1-Hour Order |
|---|---|---|
| Endpoint | /apiv2/order5m | /apiv2/order1h |
| Duration | 5 minutes | 1 hour |
| Energy range | 61,000 - 650,000 | 61,000 - 3,000,000 |
| Providers | Netts internal pools only | Internal pools + external providers |
| Price | Lower (5-minute rate) | Standard hourly rate |
| Availability | May be limited during peak | High (multiple provider fallback) |
| Best for | Frequent small transactions | Large 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