API Intergration for TR.ENERGY
What is an API key and why does Tr.energy need it?
An API key is a special authentication mechanism used to ensure the security of the Tr.energy API service and prevent unauthorized access to your data. This is a unique string that the system generates and assigns to each user to confirm their legitimacy when accessing the API. Users are required to include an API key in the header of their requests to prove their identity. This prevents possible malicious attacks and abuses, protecting the integrity and functionality of our system.
How to get API key
1. Log in to the system and go to the Settings page in the API section.
2. Click the "Generate" button to get key. Then, the system will generate a unique API key for you.
3. Copy the generated API key to your application to authenticate your identity when calling the Tr.energy API service.
4. Follow the link to learn how to interact with our API.
Notes
1. Do not share your API key with anyone to prevent unwanted use of it.
2. If your API key is lost or leaked, please contact our customer support - [email protected]
3. If you need further assistance or encounter any problem, please email us - [email protected]
1. AUTHORIZATION
It happens automatically when using API key in the header (Bearer Token).
2. BALANCE CHECK
Use method GET 1.1. Show
3. TOP UP
Use method GET 1.2. Top up
4. CREATION AND ACTIVATION OF ORDER
Use method POST 2.0 Create & Activate
Before sending energy, our system will automatically check whether the address is activated on the TRON network. If not, it will activate it and deduct the payment for this service from the user's balance. After that, the energy will be sent to the address.
When the "webhook_url" parameter is set, after the order is completed, the server will send a POST request:
{
"status": true,
"address": your_consumer_wallet_address
}
5. DISPLAYING THE LIST OF ENERGY CONSUMERS
(These are the wallets to which energy is delegated.)
To display 1 address use method GET 2.3. Show
To display all addresses use method GET 2.1. Index
6. UPDATING DATA OF ENERGY CONSUMERS
(You can change consumer name, energy quantity, energy lease period, auto-renewal status)
Use method PATCH 2.6. Update
Auto-renewal function - POST 2.8. Toggle Auto Renewal
7. CREATION AND ACTIVATION OF ORDER (sequentially)
Use method POST 2.2 Create, then POST 2.4 Activate order
8. DEACTIVATING AN ENERGY ORDER
Use method POST 2.5. Deactivate
9. REMOVING AN ENERGY CONSUMER
Use method DELETE 2.8. Destroy
How to implement the work of transit wallets with TR.ENERGY
You create a new wallet in your system, accept cryptocurrency from clients there, check the purity" of the transaction. If you are satisfied with the result, you can send these funds to your main wallet. For one transaction, 64k-130k of energy is enough (depending on the load of the TRON network)
To do this, you need to create an energy order on this wallet
Use method POST 2.2. Create. Create a request with the following parameters:
{
"payment_period": 15,
"address": "TY3dRk4eQ75dCrW7tUcCzggU9rnz4V111",
"auto_renewal": 0,
"resource_amount": 65150,
"name": "transit-TY3dR"
}
Receive a response to the request
{
"data": {
"id": 2416165,
"name": "transit-TY3dR",
"address": "TY3dRk4eQ75dCrW7tUcCzggU9rnz4V111",
"resource": "ENERGY",
"resource_amount": 65150,
"estimated_cost_trx": 3.48,
"desired_resource_amount": 65150,
"creation_type": 2,
"recharge_type": null,
"payment_period": 15,
"auto_renewal": false,
"is_active": false,
"activation_queue": false,
"order": null,
"threshold": null,
"webhook_url": null,
"activated_at": null,
"deactivated_at": null,
"created_at": "29-09-2025 08:44:18",
"updated_at": "29-09-2025 08:44:18"
},
"status": true
}
If you previously used the POST 2.2 Create method, then activate the order separately.
create a request POST 2.4. Activate with the following parameters:
core.tr.energy/api/consumers/{ID_your_consumer}/activate
If the balance is sufficient, wait a few seconds to receive the selected resource and you can proceed with the transfer.