Create Order
Create resource order
Core API: Create Order (POST /order)
When creating an order through Mefree.net's API, it is crucial to track the following three return values:
pay_hash
(Payment Hash / Order ID):This is a unique identifier for the order.
Use it to query the order details via the GET
/order/{pay_hash}
endpoint.
status
(Order Status):Indicates the progress of the order.
When the
status
isDELEGATE_SUCCESS
, it means the energy transaction has been successfully submitted to the TRON blockchain.Note: A very small chance (~0.1%) exists where the transaction may not be added to the chain.
confirm_status
(On-chain Confirmation Status):Confirms whether the energy has been successfully transferred on-chain.
When
confirm_status
isDELEGATION_CONFIRMED
, it guarantees that the energy has been delivered to the target address.
Q: How to ensure that energy is sent to the address?
There are two ways to verify successful energy delivery:
Query the energy balance of the address via the TRON API:
Use TRON's official API or a TRON wallet (e.g., TronLink) to check the target address's current energy balance.
Endpoint Example (TRON Grid API):
Parse the response to check the
energy_limit
orenergy_used
field.
Check the
confirm_status
of the order:Use the GET
/order/{pay_hash}
endpoint to retrieve the order details.If
confirm_status
isDELEGATION_CONFIRMED
, the energy transaction has been confirmed on the blockchain, and the target address has received the energy.
Example Workflow
1. Create an Order
Request:
Response:
2. Query Order Details
Request:
Response:
3. Verify Energy Delivery
If
confirm_status
=DELEGATION_CONFIRMED
, the energy has been delivered.Alternatively, check the energy balance of the receiver address via TRON’s blockchain API.
By combining order tracking (pay_hash
and confirm_status
) and on-chain verification, you can ensure that energy transactions are reliable and properly executed. If any issues arise, contact Mefree support(@mefreenet) for assistance.
Last updated