Create Order
PATH:POST /open/api/v4/merchant/trade/create
❗️This API can only be invoked on the server side.
Header:
Parameter | Mandatory | Type | Remarks |
---|---|---|---|
access-token | Y | string | Login-free accessToken value, which can be obtained from the access token interface |
appId | Y | string | App unique identifier |
timestamp | Y | string | Current UTC 13-digit timestamp, valid within 5 minutes |
sign | Y | string | Signature, you can refer to the signature Click Here |
Body:
Parameter | Mandatory | Type | Remarks |
---|---|---|---|
side | Y | string | Pass value: BUY |
merchantOrderNo | Y | String | The merchant's custom order number and the merchant needs to guarantee it is unique. |
amount | Y | String | The purchase amount of fiat currency; the number of digits needs to be controlled according to the precision of the fiat currency. A precision of 0 means an integer and a precision of 2 means two decimal places. For accuracy, please refer to Basic Data - Legal Currency and Payment Method |
fiatCurrency | Y | string | Fiat code, USD/EUR, etc. |
cryptoCurrency | Y | string | Crypto name. example: USDT |
depositType | Y | int | Fixed value 2 |
address | Y | string | The address where the user receives the digital currency |
network | Y | string | Crypto acquiring network: eg: ETH/BSC/BTC, etc. |
payWayCode | Y | string | Payment method code: For the specific value, please refer Click Here |
redirectUrl | N | string | The redirection address after the successful purchase of coins |
callbackUrl | N | string | Callback address after a successful purchase |
memo | N | string | Note: BNB network 'memo' parameter is mandatory. |
failRedirectUrl | N | string | The page redirect address after the coins purchase fails, if not passed in, the payment failure will also jump to the redirect URL |
merchantName | N | string | Merchant name, if passed in, the merchant name will be displayed on the payment result page |
Example
Request Parameters:
{
"side": "BUY",
"cryptoCurrency": "USDT",
"address": "TSx82tWNWe5Ns6t3w94Ye3Gt6E5KeHSoP8",
"network": "TRX",
"fiatCurrency": "USD",
"amount": "100",
"depositType": 2,
"payWayCode": "10001",
"redirectUrl": "http://payment.jyoumoney.com/alchemy/payResultPage/DZ02207121427022754",
"callbackUrl": "http://payment.jyoumoney.com/alchemyRamp/pay/callback?tradeNo=DZ02207091800356504"
}
Response Parameters:
{
"success": true,
"returnCode": "0000",
"returnMsg": "SUCCESS",
"extend": "",
"data": {
"orderNo":"945628891261980032",
"payUrl": "<http://www.amazon.com?token=aaaa&userNo=bbbb&email=cccc&orderNo=xxxx&id=xxxx&cardFlag=false>" //支付跳转地址
}
}
{
"success": false,
"returnCode": "3103",
"returnMsg": "Please refresh timestamp",
"extend": "",
"data": null,
"traceId": "64ed9681618806b022dd303e2ea1ed13"
}
Return Code List Click Here
Updated 4 months ago