Skip to main content

6.1.3 Create OTC payment order

#Brief description: Fiat currency withdrawals through OTC

Request parameters

Parameter nameTypeRequiredParameter meaningParameter description
keystringYesMerchant keyapiKey
localOrderIdstringYesMerchant platform local order numberMerchant platform generates unique order number locally
localUserIdstringNoMerchant platform local user IDMerchant platform local user ID
notifyUrlstringNoCallback addressAfter the order is successfully processed, the address of the merchant will be notified by API callback (callback details are at the bottom)
currencystringYesWithdrawal currencyDefault CNY
amountnumberYesWithdrawal amountYou 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
methodstringYesPayment methodALIPAY (Alipay), UNIONPAY (UnionPay card), WECHAT (WeChat), DIGITAL_RMB (Digital RMB)
paymentDatajsonYesPayment informationPlease refer to the code request sample below
└payee
└accountId

└payee
└accountId

└cardNo
└payee
└bankName

└payee
└walletCode
stringYespayee (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}
speedstringYesTransaction speedCan 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)
signstringYesSignatureSee 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 nameTypeParameter meaning
orderIdLongOrder number
localOrderIdstringMerchant 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 nameTypeParticipating signatureParameter meaningParameter description
amountdecimalYesOrder Amount
currencyStringYesCurrency
localOrderIdStringYesLocal order number
merchantIdLongYesMerchant ID
merchantUserIdStringYesMerchant's user ID
notifyTimeLongYesCallback time
orderCreateTimeLongYesOrder Creation Time
orderIdStringYesOrder number
statusStringYesPayment statusSUCCESS: Completed | FAIL: Failed
signStringNomd5 signaturePlease see signature algorithm for details
keyStringYesapi 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