跳到主要内容

创建转账订单

POST/api/v1/transfer/command/createHMAC

发起钱包间转账。订单异步处理,返回 PENDING 状态。

请求头

NameTypeRequiredDescription
X-Api-KeystringrequiredAPI 密钥标识符
X-SignaturestringrequiredHMAC-SHA256 签名
X-TimestampstringrequiredUnix 时间戳(秒)
X-Noncestringrequired唯一请求标识符(UUID)

请求体

NameTypeRequiredDescription
idempotentKeystringrequired客户端提供的幂等键,每次转账唯一. maxLength: 128 | minLength: 0
fromWalletIdstringrequired来源钱包业务 ID. maxLength: 64 | minLength: 0
toWalletIdstringrequired目标钱包业务 ID. maxLength: 64 | minLength: 0
currencystringrequiredISO 币种代码. maxLength: 5 | minLength: 3
amountnumberrequired交易金额(主币种单位)
remarkstringrequired转账的备注或附言(可选). maxLength: 256 | minLength: 0

请求示例

curl -X POST https://api.elaypay.app/api/v1/transfer/command/create \
-H "X-Api-Key: sk_live_xxx" \
-H "X-Signature: <computed_signature>" \
-H "X-Timestamp: 1709337600" \
-H "X-Nonce: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json" \
-d '{
"idempotentKey": "txn_20260302_001",
"fromWalletId": "wlt_sender_001",
"toWalletId": "wlt_receiver_002",
"currency": "USD",
"amount": 100.5,
"remark": "Monthly payment"
}'

响应

201已创建
{
"version": "1.3.0",
"success": true,
"code": "2001",
"message": "CREATED",
"data": {
"bizId": "txn_ghi789",
"fromWalletId": "wlt_sender_001",
"toWalletId": "wlt_receiver_002",
"currency": "USD",
"amount": 100.5,
"feeAmount": 0.5,
"totalAmount": 101,
"status": 10060101,
"statusName": "PENDING",
"failureReason": null,
"remark": "Monthly payment",
"createdAt": "2026-03-02T11:20:00Z",
"completedAt": null
}
}