6.1.3 Create OTC payment order
#Brief description: Fiat currency withdrawals through OTC
- Request method: POST
- Request interface: https://gateway-domain/wallet-trade-merchant/v1/otc/payment/create
- Request media type (JSON data format)Content-Type: application/json
Request parameters
| Parameter name | Type | Required | Parameter meaning | Parameter description |
|---|---|---|---|---|
key | string | Yes | Merchant key | apiKey |
localOrderId | string | Yes | Merchant platform local order number | Merchant platform generates unique order number locally |
localUserId | string | No | Merchant platform local user ID | Merchant platform local user ID |
notifyUrl | string | No | Callback address | After the order is successfully processed, the address of the merchant will be notified by API callback (callback details are at the bottom) |
currency | string | Yes | Withdrawal currency | Default CNY |
amount | number | Yes | Withdrawal amount | You can customize the quota (cannot enjoy the channel fee discount, the default transaction speed of this order is NOW) or obtain the order amount through the document 6.1.2 interface (this amount can enjoy the channel fee discount) can be accurate to two decimal places |
method | string | Yes | Payment method | ALIPAY (Alipay), UNIONPAY (UnionPay card), WECHAT (WeChat), DIGITAL_RMB (Digital RMB) |
paymentData | json | Yes | Payment information | Please refer to the code request sample below |
| └payee └accountId | └payee └accountId | └cardNo └payee └bankName | └payee └walletCode | string | Yes | payee (Payee name), accountId (payment account number), cardNo (bank card number), bankName (bank name), walletCode (digital RMB code) | Parameter example: Alipay payment parameters { "payee":"Conan","accountId":13888888888} WeChat payment parameters { "payee":"Conan","accountId":13888888888} UnionPay card payment parameters { "payee":"Conan","cardNo":13888888888,"bankName":"Bank of China"} Digital RMB payment parameters { "payee":"Conan","walletCode":13888888888} |
speed | string | Yes | Transaction speed | Can be obtained through the document 6.1.1 interface (if it is NOW, it means that this order will not enter the matching pool and will be directly processed manually by the operator) |
sign | string | Yes | Signature | See Signature Algorithm for details |
Request json sample
{
"key": "dNNTJZpgFVWlYrVv",
"localOrderId": "899952123",
"localUserId": "4114",
"notifyUrl": "http://127.0.0.1:8080/merchant-demo1/notify/test",
"currency": "CNY",
"amount": 100,
"method": "UNIONPAY",
"paymentData": {
// 银联卡
"payee":"柯南",
"cardNo":13888888888,
"bankName":"中国银行"
// 支付宝
// "payee":"柯南",
// "accountId":13888888888
// 微信
// "payee":"柯南",
// "accountId":13888888888
// 数字人民币
// "payee":"柯南",
// "walletCode":13888888888
},
"speed": "NOW",
"sign":"c6e3c292bb8cafaea50d4001185e6112"
}
Response Example
{
"code": 0,
"success": true,
"message": null,
"data": {
。 "orderId": 415236189438341,
"localOrderId": "899952123"
}
}
Response data parameter description
| Parameter name | Type | Parameter meaning |
|---|---|---|
orderId | Long | Order number |
localOrderId | string | Merchant platform custom order number |
Callback details
The callback method is: POST application/json
Callback parameter json example
{
"amount":"100",
"currency":"CNY",
"localOrderId":"8999521232121336",
"merchantId":302992856974,
"merchantUserId":"4114",
"notifyTime":1766134282162,
"orderCreateTime":1766133956739,
"orderId":"423044353278405",
"status":"SUCCESS",
"sign":"563eabc8cff14e401d426ff385b643ba",
"key":"9yUreYgTRtit39Dy"
}
| Parameter name | Type | Participating signature | Parameter meaning | Parameter description |
|---|---|---|---|---|
amount | decimal | Yes | Order Amount | |
currency | String | Yes | Currency | |
localOrderId | String | Yes | Local order number | |
merchantId | Long | Yes | Merchant ID | |
merchantUserId | String | Yes | Merchant's user ID | |
notifyTime | Long | Yes | Callback time | |
orderCreateTime | Long | Yes | Order Creation Time | |
orderId | String | Yes | Order number | |
status | String | Yes | Payment status | SUCCESS: Completed | FAIL: Failed |
sign | String | No | md5 signature | Please see signature algorithm for details |
key | String | Yes | api key |
When you receive the callback notification, please directly return the string success after the processing is completed, indicating that the message has been successfully received and processed. After the system receives the success response, it will no longer send the callback repeatedly. If the expected response is not received (success is not returned or an exception is returned), the system will resend the callback notification according to the stepped retry mechanism, retrying up to 14 times. The current retry intervals are: 15s, 15s, 30s,180s, 600s, 1200s, 1800s, 1800s, 1800s,3600s,10800s,10800s,21600s, 21600s