创建订单

介绍

该接口用于创建订单。

接口说明

请求方式:POST

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

请求参数

Header参数:

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

Body参数:

参数名必选类型说明
sideYstringonramp:BUY
offramp:SELL
merchantOrderNoYString接入商家自定义订单号,商家保证商户订单号是唯一的。
amountYStringonramp:法币购买金额 ,单位元;需要根据法币精度控制位数,精度为0表示整数,精度为2表示保留两位小数。精度参见:基础数据-法币币种及支付方式
offramp:下单crypto的数量
fiatCurrencyYstring法币名称,USD/EUR等
alpha2NstringISO 3166-1 二位字母国家code,如us/jp等。offramp必传
cryptoCurrencyYstring数字货币名称,举例:USDT
orderTypeYstringonramp:4
offramp:6
addressNstringonramp必填,用户接收数字货币的地址
networkYstringcrypto接收网络:eg:ETH/BSC/BTC等
payWayCodeYstring支付方式代码:信用卡:10001、Apple Pay:501、Google Pay:701
具体值可以参照:⽀付⽅式表单查询
userAccountIdNstring提交表单接口获取的用户userAccountId
redirectUrlYstringonramp:买币成功后页面跳转地址
callbackUrlYstring回调地址
memoNstring视乎网络或平台需要填写
extendParamsNobject信用卡支付方式(payWayCode=10001)必传,如何获取参考 信用卡支付获取cookie
└─channelCookieNstring通道Cookie
└─ cookieNstring风控Cookie
clientIpYstring用户IP

请求参数示例(onramp):

{
 "side": "BUY",
 "merchantOrderNo":"mer100001",
 "cryptoCurrency": "USDT",
 "address": "TSx82tWNWe5Ns6t3w94Ye3Gt6E5KeHSoP8",
 "network": "TRX",
 "memo": "123123", //Optional
 "fiatCurrency": "USD",
 "amount": "100",
 "orderType": "4", // 固定传4
 "payWayCode": "10001",
 "userAccountId": "12312", // Optional 卡⽀付、账⼾必填
 "redirectUrl":
"http://payment.jyoumoney.com/alchemy/payResultPage/DZ02207121427022754",
 "callbackUrl":
"http://payment.jyoumoney.com/alchemyRamp/pay/callback?tradeNo=DZ02207091800356504"
 }

返回参数示例(onramp):

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "orderNo": "onramp100001",
        "webUrl": "https://www.google.com"
    }
}

请求参数示例(offramp):

{
    "side": "SELL",
    "merchantOrderNo": "mer100001",
    "cryptoCurrency": "USDT",
    "network": "ETH",
    "amount": "123.123", // crypto sell quantity
    "alpha2": "US",
    "fiatCurrency": "USD",
    "payWayCode": "10001",
    "userAccountId": "12312",
    "orderType": 6, // 固定传6
    "callbackUrl": "http://payment.jyoumoney.com/alchemyRamp/pay/callback?tradeNo=DZ02207091800356504"
}

返回参数示例(offramp):

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "orderNo": "offramp100001",
        "receivedAddress": "0xcbca4e794dcb053d0ca8a9cb666df44f56af7c38"
    }
}