Tron Energy Marketplace API
Welcome to the official documentation for our Tron Energy Marketplace API. Here you can find details about the public endpoints that allow you to:
- Retrieve current platform parameters (energy price, available supply, minimum order size, and deposit address).
- Check the status of a specific energy purchase order by deposit hash.
- Buy energy programmatically from a prepaid balance, without sending a deposit for every order.
The two GET endpoints below are public and require no authentication. Buying energy requires an API key: issue one in your cabinet and send it in the X-Api-Key header. Buyer Settings
Pass the key in the header only. Query strings end up in server logs.
Endpoint Overview
GET
https://api.tron.discount/energy/info
Returns the platform's live settings such as whether the system is active, how much energy is available, the energy price, deposit address, etc.
GET
https://api.tron.discount/energy/order/{depositHash}
Returns the status of a specific purchase order, including transaction hashes and delegation details.
POST
https://api.tron.discount/energy/order
API key
Buys energy from your prepaid balance. No deposit transaction needed.
GET
https://api.tron.discount/energy/order/api/{id}
API key
Returns the status of an order placed through the API, by its numeric id.
Detailed Endpoints
/energy/info
Description
Provides parameters like current energy price, how much energy is available, the deposit address, and other info (e.g., server time, whether the system is active).
Request
curl -X GET https://api.tron.discount/energy/info
Response
{
"isSystemActive": true,
"maximumEnergyAvailable": 1141839310,
"energyUnitPriceInSun": 50,
"minEnergyOrderAmount": 32000,
"depositAddress": "TSD2AWZeyvE4CFvSfYZ1wiPhKoXxWurLUe",
"serverTime": "2025-04-05T15:24:05.785059Z"
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
isSystemActive |
Boolean | Indicates if the marketplace is operational. |
maximumEnergyAvailable |
Integer | The total energy units currently available for purchase. |
energyUnitPriceInSun |
Integer | The cost (in SUN) per unit of energy. (1 TRX = 1,000,000 SUN) |
minEnergyOrderAmount |
Integer | Minimum amount of energy (units) for a single order. |
depositAddress |
String | Tron address to which buyers send TRX. The system automatically delegates energy to the sender once payment is received. |
serverTime |
String | Server timestamp in ISO format. |
/energy/order/{depositHash}
Description
Retrieves the status of a purchase order associated with the provided deposit transaction hash.
Request
curl -X GET https://api.tron.discount/energy/order/d663302b6a303053b8de9a018ea14cbaca9d0cf0e38a498cc86d04748e3bec14
Response
{
"depositHash": "d663302b6a303053b8de9a018ea14cbaca9d0cf0e38a498cc86d04748e3bec14",
"delegationHash": "b9458d06b1f05ff5d1b2448afa6efb548f7792dd6997ab9cb4e2ce6fbbd560a0",
"refundHash": null,
"status": "ResourcesDelegated",
"created": "2024-06-01T14:38:32",
"executed": "2024-06-01T14:40:10",
"targetAddress": "TDqSquXBgUCLYvYC4XZgrprLK589dkhSCf",
"depositAmount": 3.89,
"energyAmount": 32416
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
depositHash |
String | Transaction hash of the deposit (TRX sent to the platform). |
delegationHash |
String | Transaction hash of the on-chain delegation (if any). |
refundHash |
String | Transaction hash of any refund (if applicable, otherwise null). |
status |
String | Order status (e.g., "ResourcesDelegated", "Refunded", "Pending", etc.). See the status descriptions below. |
created |
String | Timestamp when the order was first detected. |
executed |
String | Timestamp when the system successfully delegated or processed the order. |
targetAddress |
String | Tron address that received the delegated energy. |
depositAmount |
Number | Amount of TRX received from the deposit transaction. |
energyAmount |
Integer | Quantity of energy units delegated to the target address. |
Order Status Values
Possible values for the status field:
| Status | Description |
|---|---|
Created |
Order has been created but not yet processed. |
Pending |
Payment received and order is being processed. |
ResourcesDelegated |
Energy has been successfully delegated to the target address. |
RefundRequested |
A refund has been requested but not yet processed. |
PendingRefund |
Refund is being processed. |
Refunded |
TRX has been refunded to the sender. |
/energy/order
API keyDescription
Places an order and charges its cost to your prepaid balance. Unlike the deposit flow, no on-chain transfer is required for each order.
Top up the balance by sending TRX to your personal recharge address, shown in your cabinet. Buyer Settings
Request
curl -X POST https://api.tron.discount/energy/order \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"receiveAddress": "TW7X17...uCntDs2",
"resourceValue": 32000,
"rentDurationInHours": 1,
"clientOrderId": "order-2024-001"
}'
Request Fields
| Field | Type | Description |
|---|---|---|
receiveAddress |
String | Tron address that will receive the delegated energy. Required. |
resourceValue |
Integer | Amount of energy units to buy. Required, at least minEnergyOrderAmount. |
rentDurationInHours |
Integer | Rental duration in hours. Optional; the only supported value is 1, which is also the default. |
clientOrderId |
String | Your own order number, up to 64 characters. Optional but strongly recommended: repeating a request with the same value returns the original order instead of charging you twice. |
Response
{
"id": 1024,
"status": "Created",
"chargedInSun": 1600000,
"priceInSun": 50,
"balance": 96.920000
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
id |
Integer | Order identifier. Use it to request the status later. |
status |
String | Order status, same values as the deposit flow. A freshly accepted order is "Created". |
chargedInSun |
Integer | Amount charged for this order, in SUN. |
priceInSun |
Integer | Price per energy unit locked in at the moment the order was accepted. |
balance |
Number | Remaining prepaid balance in TRX after the charge. |
Errors
A refused order returns a JSON body with a stable machine-readable code and a human-readable message. Branch on the code: the message is not part of the contract and may change at any time.
{
"code": "insufficient_balance",
"message": "Insufficient balance: 1.500000 TRX, required 4 TRX"
}
| HTTP | code |
Description |
|---|---|---|
400 |
insufficient_balance |
Not enough prepaid balance for this order. Top up your recharge address and repeat the request with the same clientOrderId. Nothing was charged. |
400 |
invalid_address |
receiveAddress is not a valid Tron address. The base58check checksum is verified, so a typo is rejected rather than delegated into the void. |
400 |
invalid_resource_value |
resourceValue is below minEnergyOrderAmount or above the maximum allowed for a single order. |
400 |
invalid_rent_duration |
rentDurationInHours is not 1. The platform rents energy for one hour only. |
400 |
invalid_client_order_id |
clientOrderId is longer than 64 characters. |
400 |
invalid_request |
The request body is missing or unreadable. |
401 |
— | The key is missing, revoked or unknown. |
503 |
system_inactive |
The system is not accepting orders right now. Retry later; nothing was charged. |
/account/recharge-address
API keyDescription
Returns your personal recharge address. ready is false while the address has not been issued yet: for a brand-new account or right after a regeneration that did not complete in time.
Request
curl -X GET https://api.tron.discount/account/recharge-address \
-H "X-Api-Key: tde_your_key_here"
Response
{
"address": "TQmZ1p...c8XA1",
"ready": true,
"nextChangeAllowedAt": "2026-09-12T10:00:00Z"
}
/account/recharge-address/regenerate
API keyDescription
Replaces your recharge address with a new one. Allowed once per day.
Request
curl -X POST https://api.tron.discount/account/recharge-address/regenerate \
-H "X-Api-Key: tde_your_key_here"
Response
{
"newAddress": "TAqM7b...pkTdZx",
"oldAddress": "TQmZ1p...c8XA1",
"oldAddressActiveUntil": "2027-03-10T10:00:00Z",
"nextChangeAllowedAt": "2026-09-12T10:00:00Z"
}
Errors
| HTTP code | code | Meaning |
|---|---|---|
| 429 | address_change_too_soon |
Less than a day since the previous change. The Retry-After header tells how many seconds to wait. |
/energy/order/api/{id}
API keyDescription
Returns the status of an order placed through the API. Orders paid from the balance have no deposit hash, so they are addressed by the id returned when the order was accepted.
Only your own orders are visible: an id belonging to another account returns 404.
Request
curl -X GET https://api.tron.discount/energy/order/api/1024 \
-H "X-Api-Key: YOUR_API_KEY"
Response
{
"id": 1024,
"clientOrderId": "order-2024-001",
"status": "ResourcesDelegated",
"receiveAddress": "TW7X17...uCntDs2",
"resourceValue": 32000,
"rentDurationInHours": 1,
"chargedInSun": 1600000,
"created": "2025-04-05T15:24:05.785059Z",
"updated": "2025-04-05T15:24:41.120344Z"
}
The status values are the same as for the deposit flow, listed above.
OpenAPI Specification
Complete API specification is available in OpenAPI/Swagger format for advanced integration and automated tooling:
Additional Notes
Authentication
The GET endpoints for platform info and deposit orders stay public and need no key. Buying energy from the balance requires an API key in the X-Api-Key header.
Issuing a new key immediately invalidates the previous one, and the key is shown only once.
Two Ways to Order
Sending TRX to the deposit address creates an order implicitly and needs no key. Ordering from a prepaid balance takes one API call and no on-chain transfer. Both are processed by the same pipeline and share the same status values.
Energy Units & SUN
Remember, 1 TRX = 1,000,000 SUN. So if energyUnitPriceInSun is 50, that means 0.000050 TRX per unit of energy.
Implicit Order Creation
An "order" is created automatically whenever TRX is sent to the deposit address. Use the deposit transaction hash to track the status.
Server Time
Times are given in ISO 8601 format (UTC). Keep timezones in mind when comparing to local times.