GET

查询订单

/api/v1/energy/orders/:order_id

按 id 查询单个订单。轮询此接口以获取异步订单的结果。

路径参数

参数类型说明
order_idstring创建订单时返回的订单 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_totalstring下单时约定的总金额,单位 TRX(十进制字符串,非 SUN)。普通订单等于 customer_price。
actual_consumedstring实际扣款金额,单位 TRX。普通订单等于 customer_price。
customer_pricestring订单价格,单位 TRX(十进制字符串,非 SUN;1 TRX = 10^6 SUN)。
currencystring始终为 TRX。
tx_infoobject | null公开的链上委托/回收详情。订单进行中可能为 null。

tx_info 对象只包含公开的链上事实:

字段类型说明
delegate_tx_hashstring | null委托交易哈希。
reclaim_tx_hashstring | null回收交易哈希。
delegate_timestring | null委托时间(链上上报)。
reclaim_timestring | null回收时间(链上上报)。
resource_addressstring | null实际委托资源方地址。

错误

  • ORDER_NOT_FOUND —— 订单不存在或不属于你。