创建收款单(TRC20)
创建 USDT-TRC20 收款订单接口。
请求资讯
- 请求 URL:
/gateway/api/v1/tron/payment-txns - 请求方式:
POST - Content-Type:
application/json;charset=utf-8
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| platform_id | 是 | String(7) | 商户 ID |
| txn_cl_id | 是 | String(32) | 商户订单号(长度 1~32) |
| user_id | 否 | String(32) | 汇款人平台 ID |
| creator_address | 是 | String(34) | 打款人地址(以此来对帐上分) |
| amount | 是 | Integer(10) | 订单金额 (单位:0.01 USDT) 例如:50000 表示提单 500 USDT |
| notify_url | 是 | String(256) | 交易结果通知地址 |
| request_time | 是 | Integer(10) | 请求时间(秒) |
| sign_type | 否 | String(16) | 签名类型:HMAC-SHA256(推荐)或 MD5(默认) |
| sign | 是 | String(32 | 64) |
请求示例
{
"platform_id": "PF0001",
"user_id": "b929c18b83bf47809e1595ff6b28916a",
"txn_cl_id": "test_payment_txn_1755705625",
"creator_address": "TAkr13ZMWyPSpo7jvQ4ajgmm8X9EG4dEZK",
"amount": 12345,
"notify_url": "https://notify.com/payments",
"request_time": 1755705625,
"sign": "660b1bb75801bedd796d7b33ae089ef5"
}
返回示例
成功返回
{
"error_code": "0000",
"data": {
"txn_id": "CTX00000123",
"txn_cl_id": "test_payment_txn_1755705625",
"type": 0,
"network": "TRC-20",
"target_address": "TAkr13ZMWyPSpo7jvQ4ajgmm8X9EG4dEZK",
"amount": 12345,
"pay_link": "http://localhost:8889/payment/index.html?token=eyJhbG"
}
}
错误返回示例
{
"error_code": "0004",
"error_msg": "验签错误!"
}
返回参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| error_code | String | 错误码 |
| error_msg | String | 错误讯息(error_code 不为 "0000" 时返回) |
| pay_link | String | 订单收银地址 |
| amount | Int | 提单金额 |
| txn_id | String | 平台订单号 |
| txn_cl_id | String | 商户订单号 |
| target_address | String | 接收地址 |
| user_id | String | 汇款人平台用户名 (ID) |
备注
- 金额单位为 0.01 USDT,例如 500 USDT 应传入 50000