Skip to main content

PayOut

API description

use payout api to transfer currency to user

Interface Information

  • Interface URL: POST /v2/payout
  • Content-Type: application/json
  • Authentication: Need to pass app-id and signature verification in Header

Request Header Parameters

ParameterTypeRequiredDescription
app-idstringYesMerchant Application ID
Content-TypestringYesapplication/json

Request Parameters

ParameterTypeRequiredDescription
signstringYesRequest signature
amountstringYesPayout amount
currencystringYesCurrency type (e.g., USD, USDT)
outTradeNostringYesMerchant order number, must be unique
payChannelstringYesPayment channel name (e.g., xpay)
currencyIdstringYesCurrency ID for the specific token
receiverstringYesRecipient address (Settlement channel: wallet address format like 0x..., Other channels: phone number format like +86-43483243)
extraobjectNoExtended parameters

Extra Parameter Description

ParameterTypeRequiredDefault ValueDescription
descriptionstringNo"payout transaction"Transaction description
memostringNo""Transaction memo or note

Response Parameters

Success Response

{
"code": 0,
"data": {
"order_no": "1754377439308531400",
"status": "success",
"extra": {
}
},
"msg": "success"
}

Error Response

{
"code": 7,
"data": {},
"msg": "insufficient token balance"
}

Request Examples

cURL Example

curl -X POST "/v2/payout" \
-H "Content-Type: application/json" \
-H "app-id: your-app-id" \
-d '{
"sign": "c2lnbmF0dXJlX3Rlc3Q=",
"amount": "1",
"currency": "USD",
"outTradeNo": "wendjfdsj",
"payChannel": "xpay",
"currencyId": "P575ItNeMxM6fy6zhbnrlezYlvQnHMLZ",
"receiver": "0xB0c5852ff023291D0de6333c9155b2f884368559",
"extra": {}
}'

Response Field Description

Success Response Fields

FieldTypeDescription
codeintegerResponse code, 0 indicates success
dataobjectResponse data
data.order_nostringSystem generated order number
data.statusstringTransaction status (pending, confirmed, failed)
data.extraobjectAdditional transaction information
msgstringResponse message

Error Response Fields

FieldTypeDescription
codeintegerError code
dataobjectEmpty object for error responses
msgstringError message description

Error Codes

CodeDescription
0Success
7Insufficient token balance

Important Notes

  1. Signature Verification: All requests must include a valid signature in the sign parameter
  2. Unique Order Numbers: The outTradeNo must be unique for each payout request
  3. Address Validation: Ensure the receiver address is valid for the specified currency
  4. Balance Check: Verify sufficient balance before initiating payout
  5. Transaction Monitoring: Use the returned txHash to monitor transaction status on blockchain

For the complete list of supported channels and currencies, please refer to the Channel and Currency API.


Query PayOut Order

API Description

Use this API to query the status and details of a payout order.

Interface Information

  • Interface URL: POST /v2/queryPayOutOrder
  • Content-Type: application/json
  • Authentication: Need to pass app-id and signature verification in Header

Request Header Parameters

ParameterTypeRequiredDescription
app-idstringYesMerchant Application ID
Content-TypestringYesapplication/json

Request Parameters

ParameterTypeRequiredDescription
signstringYesRequest signature
outTradeNostringYesMerchant order number

Response Parameters

Success Response

{
"code": 0,
"data": {
"merchantId": 2,
"appId": "app-caf118dc-4e23-4ced-ab23-8a3f65d5071a",
"merchantOrderNo": "wendjfdsj",
"orderNo": "1752664386848723000",
"channelName": "xpay",
"tokenSymbol": "USD",
"tokenCount": "1",
"tokenFeeCount": "",
"currencyId": "P575ItNeMxM6fy6zhbnrlezYlvQnHMLZ",
"payHash": "",
"transactionID": "",
"receiver": "0xB0c5852ff023291D0de6333c9155b2f884368559",
"state": "DONE_PAYMENT",
"extra": "{\"channel_pay_type\":\"cards\",\"description\":\"xxxx\"}",
"payTime": 0
},
"msg": "success"
}

Error Response

{
"code": 7,
"data": {},
"msg": "invalid order"
}

Request Examples

cURL Example

curl -X POST "/v2/queryPayOutOrder" \
-H "Content-Type: application/json" \
-H "app-id: your-app-id" \
-d '{
"sign": "cxxnbmF0dXJlX3Rlc3Q=",
"outTradeNo": "12344545"
}'

Response Field Description

Success Response Fields

FieldTypeDescription
codeintegerResponse code, 0 indicates success
dataobjectResponse data
data.merchantIdintegerMerchant ID
data.appIdstringApplication ID
data.merchantOrderNostringMerchant order number
data.orderNostringSystem generated order number
data.channelNamestringPayment channel name
data.tokenSymbolstringToken symbol (e.g., USD, USDT)
data.tokenCountstringToken amount
data.tokenFeeCountstringFee amount
data.currencyIdstringCurrency ID
data.payHashstringPayment transaction hash
data.transactionIDstringTransaction ID
data.receiverstringRecipient wallet address
data.statestringOrder status (PENDING, DONE_PAYMENT, FAILED)
data.extrastringAdditional information in JSON string format
data.payTimeintegerPayment timestamp
msgstringResponse message

Error Response Fields

FieldTypeDescription
codeintegerError code
dataobjectEmpty object for error responses
msgstringError message description

Order Status Values

StatusDescription
PENDINGOrder is pending processing
DONE_PAYMENTPayment completed successfully
FAILEDPayment failed

Error Codes

CodeDescription
0Success
7Invalid order or order not found

Important Notes

  1. Signature Verification: All requests must include a valid signature in the sign parameter
  2. Order Lookup: Use the same outTradeNo that was used when creating the payout order
  3. Status Monitoring: Check the state field to determine the current status of the payout
  4. Transaction Hash: The payHash field contains the blockchain transaction hash when available