GET
查询订单
/api/v1/energy/orders/:order_id
按 id 查询单个订单。轮询此接口以获取异步订单的结果。
路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
order_id | string | 创建订单时返回的订单 id。 |
响应
{
"data": {
"order_id": "ord_9c2b7f0a",
"status": "COMPLETED",
"product": "TRON_ENERGY",
"order_type": "RENTAL",
"amount": 64400,
"duration_minutes": 60,
"target_address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"customer_price": "2.093",
"order_total": "2.093",
"actual_consumed": "2.093",
"currency": "TRX",
"created_at": "2026-09-22T12:00:00.000Z",
"completed_at": "2026-09-22T12:00:05.000Z",
"failure_reason": null,
"tx_info": {
"delegate_tx_hash": "…",
"reclaim_tx_hash": "…",
"delegate_time": "…",
"reclaim_time": "…",
"resource_address": "T…"
}
},
"request_id": "…"
}
status 取值之一:PENDING、COMPLETED、FAILED、RECONCILIATION_REQUIRED。
| 字段 | 类型 | 说明 |
|---|---|---|
order_total | string | 下单时约定的总金额,单位 TRX(十进制字符串,非 SUN)。普通订单等于 customer_price。 |
actual_consumed | string | 实际扣款金额,单位 TRX。普通订单等于 customer_price。 |
customer_price | string | 订单价格,单位 TRX(十进制字符串,非 SUN;1 TRX = 10^6 SUN)。 |
currency | string | 始终为 TRX。 |
tx_info | object | null | 公开的链上委托/回收详情。订单进行中可能为 null。 |
tx_info 对象只包含公开的链上事实:
| 字段 | 类型 | 说明 |
|---|---|---|
delegate_tx_hash | string | null | 委托交易哈希。 |
reclaim_tx_hash | string | null | 回收交易哈希。 |
delegate_time | string | null | 委托时间(链上上报)。 |
reclaim_time | string | null | 回收时间(链上上报)。 |
resource_address | string | null | 实际委托资源方地址。 |
错误
ORDER_NOT_FOUND—— 订单不存在或不属于你。
