5.1.2 Create a withdrawal of digital currency to any wallet (merchant-defined exchange rate)
#Brief description: Withdraw digital currency to the wallet's withdrawal business interface, allowing users to transfer usdt to the specified wallet address (Merchant-defined exchange rate requires logging into the merchant backend to set it)
- Request method: POST
- Request interface: https://gateway-domain/wallet-trade-merchant/v1/pay/blockchain/custom/rate/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 placed, the address of the merchant will be notified by the API callback request (callback details are at the bottom) |
successRedirectUrl | string | No | Address | Automatically jump to the address after success |
currency | string | Yes | Currency | Order Currency |
network | string | Yes | Mainnet | Mainnet (currently only supports TRON, BSC, POLYGON, ETHEREUM) |
address | string | Yes | Withdrawal Address | Withdrawal Address |
quoteCurrency | string | Yes | Order quotation currency | Order quotation currency (you need to log in to the merchant backend to set the quotation currency exchange rate) |
quoteAmount | string | Yes | Quotation Amount | Quotation Amount |
isBlockchain | boolean | No | Whether to return blockchain information (default false) | When true, the callback request will carry the transaction information on the order chain |
expireSecond | Long | No | Expiration timestamp (seconds) | |
sign | string | Yes | Signature | See Signature Algorithm for details |
Request json sample
{
"key": "9yUreYgTRtit39Dy",
"localOrderId":"conantest0128",
"localUserId":"996",
"currency":"USDT",
"network":"TRON",
"address":"TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"quoteCurrency":"CNY",
"quoteAmount":"20",
"sign":"f0ef4f925b899734727b77975ff9c0a3"
}
Response json example
{
"code": 0,
"success": true,
"message": null,
"data": {
"orderId": 473228783386885,
"localUserId": "996",
"localOrderId": "conantest0128",
"orderType": "WITHDRAW",
"orderBizType": "WITHDRAW_ANY_DIGITAL_WALLET",
"targetType": "EXTERNAL",
"network": "TRON",
"address": "TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"currency": "CNY",
"userCurrency": "USDT",
"amount": "20",
"userAmount": "20",
"userReceivableAmount": "20",
"rate": "1",
"rateExpression": "1USDT≈1CNY"
}
}
Response data parameter description
| Parameter name | Type | Parameter meaning | Remarks |
|---|---|---|---|
orderId | string | Order ID | |
localUserId | string | Merchant local user ID | |
localOrderId | string | Merchant local order number | |
orderType | enum | Order Type | PAYMENT:支付订单 | WITHDRAW:提款订单 |
orderBizType | enum | Order business type | orderBizType type description is as follows |
targetType | enum | Target type | targetType type description is as follows |
network | string | Mainnet type | |
address | string | Address | On-chain payment address |
currency | string | Order currency | |
userCurrency | string | Arrival currency | |
amount | string | Order amount | |
userAmount | string | Amount actually received by the user | |
userReceivableAmount | string | User receivable amount | |
rate | string | Exchange rate | |
rateExpression | string | Exchange rate expression |
orderBizType type description:
- PAYMENT_WALLET_SCAN MINPAY wallet scan code payment
- PAYMENT_TRANSFER digital currency binding address direct deposit
- PAYMENT_ANY_DIGITAL_SCAN Scan the QR code to pay any amount of digital currency
- WITHDRAW_WALLET withdraw money to MINPAY wallet
- WITHDRAW_ANY_DIGITAL_WALLET Withdraw digital currency to any wallet
- PAYMENT_FIXED_DIGITAL_SCAN digital currency limited amount scan code payment
- BATCH_PAY batch payment
targetType type description:
- INTERNAL internal address
- EXTERNAL external address
- USER user abstract address
Callback details
The callback method is: POST application/json
Example of jsonization of callback parameters
{
"amount":"10",
"bizType":"WITHDRAW_ANY_DIGITAL_WALLET",
"currency":"CNY",
"extra":{
"quoteAmount":"10",
"quoteCurrency":"CNY",
"quotePrice":"1"
},
"localOrderId":"conantest0132",
"merchantActualAmount":"94.63",
"merchantCurrency":"CNY",
"merchantId":302992856974,
"merchantPaidAmount":"66.84",
"merchantUserId":"996",
"notifyTime":1772266852130,
"orderCreateTime":1772266745032,
"orderId":"473284157243653",
"status":"SUCCESS",
"type":"WITHDRAW",
"userAmount":"8.5",
"userCurrency":"USDT",
"userMinerFee":"1.5",
"userReceivableAmount":"10",
"sign":"78ef83b365e77c66b0cc3a283f8ebae4",
"key":"9yUreYgTRtit39Dy"
}
| Parameter name | Type | Participating signature | Parameter meaning | Parameter description |
|---|---|---|---|---|
amount | decimal | Yes | Order Amount | |
bizType | enum | Yes | Order type | bizType type description is as follows |
currency | String | Yes | Currency | |
key | String | Yes | Merchant key | |
localOrderId | String | Yes | Local order number | |
merchantActualAmount | decimal | Yes | Merchant’s actual payment amount | |
merchantCurrency | String | Yes | Merchant payment currency | Default currency |
merchantId | String | Yes | Merchant ID | |
merchantPaidAmount | decimal | Yes | Merchant payment amount | |
merchantUserId | String | Yes | User id | |
notifyTime | long | Yes | Callback time | |
orderCreateTime | long | Yes | Order Creation Time | |
orderId | String | Yes | Order number | |
status | String | Yes | Payment Status | |
type | String | Yes | Order Type | PAYMENT:支付 WITHDRAW:提款 |
userAmount | decimal | Yes | User payment amount | |
userCurrency | String | Yes | User payment currency | |
sign | String | No | md5 signature | See signature algorithm for details |
extra | object | Yes | Contains the following parameters | |
| └quoteAmount | number | Yes | Order quote amount | |
| └quoteCurrency | number | Yes | Order quote currency | |
| └quotePrice | string | Yes | Order quotation price | |
userMinerFee | String | Yes | Mining fee | Withdrawal mining fee |
userReceivableAmount | String | Yes | User receivable amount | User receivable amount |
blockchain | object | Yes | Chain transaction information | When the order request parameter isBlockchain is true, the callback request will carry this object information. (When only on-chain transactions are involved, the isBlockchain parameter will take effect) |
| └network | String | Yes | Mainnet | |
| └receiverAddress | String | Yes | Receiver Address | |
| └senderAddress | decimal | Yes | Sending Address | |
| └txId | String | Yes | Transaction ID |
bizType type description:
- PAYMENT_WALLET_SCAN MINPAY wallet scan code payment
- PAYMENT_TRANSFER digital currency binding address direct deposit
- PAYMENT_ANY_DIGITAL_SCAN Scan the QR code to pay any amount of digital currency
- WITHDRAW_WALLET withdraw money to MINPAY wallet
- WITHDRAW_ANY_DIGITAL_WALLET Withdraw digital currency to any wallet
- PAYMENT_FIXED_DIGITAL_SCAN digital currency limited amount scan code payment
- BATCH_PAY batch payment
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