想边看边试?
打开交互式 Swagger UI,填入 API Key 即可直接发送真实请求。
打开在线调试 ↗
认证与签名
所有接口通过请求头 X-API-Key 鉴权。API Key 在控制台「商户详情」一次性展示,请只保存在后端,切勿放进前端、APP 或公开仓库。Webhook 回调则用 Webhook Secret 做 HMAC 验签。
请求头
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Content-Type: application/json
创建收款订单
当客户在你的平台发起支付时,调用此接口创建一笔 USDT 收款订单。系统会自动分配唯一的「金额指纹」(精确应付金额),并返回收银台支付地址。
POST
https://zendexu.com/api/orders
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| merchant_order_id | string | 必填 | 商户系统内部订单号,需保证同商户内唯一。 |
| amount_usdt | float | 必填 | 订单的名义应收 USDT 金额,例如 120.00。系统可能在此基础上追加极小尾差作为金额指纹。 |
| payer_address | string | 选填 | 付款人真实 TRON 地址。提供后可用于归因与能量估算。 |
| notify_url | string | 选填 | 本笔订单的 Webhook 回调地址,缺省则用商户默认回调地址。 |
| return_url | string | 选填 | 支付完成后收银台跳转回的地址。 |
请求示例
cURL
POST /api/orders
curl -X POST https://zendexu.com/api/orders \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"merchant_order_id": "VIP-20260611-0001",
"amount_usdt": 120.00,
"payer_address": "T...",
"notify_url": "https://merchant.example.com/usdt/webhook",
"return_url": "https://merchant.example.com/orders/VIP-0001"
}'
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"merchant_order_id": "VIP-20260611-0001",
"amount_usdt": 120.00,
"payer_address": "T...",
"notify_url": "https://merchant.example.com/usdt/webhook",
"return_url": "https://merchant.example.com/orders/VIP-0001"
}'
响应示例 · 200 OK
{
"order_no": "ORD-ABC123",
"merchant_order_id": "VIP-20260611-0001",
"status": "pending",
"amount_usdt": 120.001, # 含金额指纹的精确应付金额
"payment_url": "https://zendexu.com/pay/ORD-ABC123"
}
"order_no": "ORD-ABC123",
"merchant_order_id": "VIP-20260611-0001",
"status": "pending",
"amount_usdt": 120.001, # 含金额指纹的精确应付金额
"payment_url": "https://zendexu.com/pay/ORD-ABC123"
}
查询订单状态
用 Zendexu 轻汇 返回的 order_no 查询订单当前状态。建议以 Webhook 为主、轮询为辅。
GET
https://zendexu.com/api/orders/{order_no}
请求示例
curl https://zendexu.com/api/orders/ORD-ABC123 \
-H "X-API-Key: YOUR_API_KEY"
-H "X-API-Key: YOUR_API_KEY"
Webhook 通知
订单在链上确认入账后,系统向 notify_url 推送 order.paid 事件。请用 Webhook Secret 验签,并以 event_id 做幂等,避免重复发货。
回调请求
X-USDT-Event: order.paid
X-USDT-Timestamp: 1718000000
X-USDT-Signature: HMAC-SHA256
{
"event": "order.paid",
"event_id": "evt_xxxxxxxxxxxxx",
"order_no": "ORD-ABC123",
"merchant_order_id": "VIP-20260611-0001",
"amount": "120.001",
"status": "paid",
"txid": "真实链上交易哈希"
}
X-USDT-Timestamp: 1718000000
X-USDT-Signature: HMAC-SHA256
{
"event": "order.paid",
"event_id": "evt_xxxxxxxxxxxxx",
"order_no": "ORD-ABC123",
"merchant_order_id": "VIP-20260611-0001",
"amount": "120.001",
"status": "paid",
"txid": "真实链上交易哈希"
}
验签算法
signature = HMAC_SHA256(
webhook_secret,
timestamp + "." + raw_body
)
webhook_secret,
timestamp + "." + raw_body
)