创建订单

介绍

该接口用于创建订单。

❗️该接口只能在服务端被调用

接口说明

请求方式:POST

请求路径:/open/api/v4/merchant/trade/create

请求参数

Header参数:

参数名必选类型说明
access-tokenYstring免登录 accessToken 值,可以从免登录获取 token 接口获取
appIdYstring应用的唯一标识
timestampYstring当前 UTC 13 位时间戳, 5 分钟内有效
signYstring签名,签名方式可参考这里

Body参数:

参数名必选类型说明
sideYstring传入BUY
merchantOrderNoYString接入商家自定义订单号,商家保证唯一。
amountYString法币购买金额 ,单位元;需要根据法币精度控制位数,精度为0表示整数,精度为2表示保留两位小数。精度参见:基础数据-法币币种及支付方式
fiatCurrencyYstring法币名称,USD/EUR等
cryptoCurrencyYstring数字货币名称,举例:USDT
depositTypeYint固定传2
addressYstring用户接收数字货币的地址
networkYstringcrypto接收网络:eg:ETH/BSC/BTC等
payWayCodeYstring支付方式代码:具体值可以参照基础数据-法币支付方式
redirectUrlNstring买币成功后页面跳转地址
callbackUrlNstring买币成功后回调地址
memoNstring注意:BNB网络memo参数必传。
failRedirectUrlNstring买币fail后页面跳转地址,如果不传入,则支付失败也会跳转至redirectUrl
merchantNameNstring商户名称,如果传入,会在支付结果页面展示商户名称

示例

请求参数:

{
    "side": "BUY",
    "cryptoCurrency": "USDT",
    "address": "TRqyVJbztwVhxJqHKZD6D8LxYk5cubfmvu",
    "network": "TRX",
    "fiatCurrency": "USD",
    "amount": "100",
    "depositType": 2,
    "payWayCode": "10001",
    "alpha2": "US",
    "redirectUrl": "http://payment.jyoumoney.com/alchemy/payResultPage/DZ02207121427022754",
    "callbackUrl": "http://payment.jyoumoney.com/alchemyRamp/pay/callback?tradeNo=DZ02207091800356504"
}

返回参数:

{  
    "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"
}

错误码说明

Code说明returnMsg
3100用户费率配置错误Please contact with our team to configure commission
3101Crypto 没有配置Please contact with our team to configure crypto
3102Amount 超出限额Quote amount exceed the range, The Min purchase amount is %s, The max purchase amount is %s
3103时间戳过期Please refresh timestamp
3104appId 不存在Please contact with our team to create account
3105地址错误Invalid Crypto Address
3106收币地址存在风险Your current withdrawal address is at risk, please check or change to another one.
3107请求路径错误Illegal request path