Create Order
Introduction
This API is used to create orders.
API Description
Request Method: POST
Request Path: /open/api/v4/merchant/order/create
Request Parameters
Header Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
access-token | Y | string | Token for no-login access, obtained from the no-login token API |
appid | Y | string | Unique identifier for the application |
timestamp | Y | string | Current UTC 13-digit timestamp, valid for 5 minutes |
sign | Y | string | Signature, refer to here |
Body Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
side | Y | string | onramp: BUY / offramp: SELL |
merchantOrderNo | Y | string | Custom order number from the merchant; the merchant guarantees that the order number is unique. |
amount | Y | string | onramp: Amount in fiat currency, unit in yuan; must control the number of decimal places according to fiat precision; precision of 0 means integer, precision of 2 means two decimal places. See: basic data - fiat currency and payment method. offramp: Amount of crypto being ordered. |
fiatCurrency | Y | string | Name of the fiat currency, e.g., USD/EUR |
alpha2 | N | string | ISO 3166-1 two-letter country code, such as US/JP, etc. Required for offramp |
cryptoCurrency | Y | string | Name of the cryptocurrency, e.g., USDT |
orderType | Y | string | onramp: 4 / offramp: 6 |
address | N | string | Required for onramp; the address for the user to receive cryptocurrency |
network | Y | string | Crypto receiving network: e.g., ETH/BSC/BTC |
payWayCode | Y | string | Payment method code(credit card:10001, apple pay:501, google pay:701); specific values can be referenced from the payment method form query |
userAccountId | N | string | User userAccountId obtained from the form submission interface |
redirectUrl | Y | string | onramp: Redirect address after successful purchase |
callbackUrl | Y | string | Callback address |
memo | N | string | To be filled according to network or platform requirements |
extendParams | N | object | Required for credit card payments (payWayCode=10001). For details on how to obtain, refer to Get cookie for credit card payment |
└─channelCookie | N | string | Channel Cookie |
└─ cookie | N | string | Risk Control Cookie |
clientIp | Y | string | User's IP |
Request Parameter Example (onramp):
{
"side": "BUY",
"merchantOrderNo": "mer100001",
"cryptoCurrency": "USDT",
"address": "TSx82tWNWe5Ns6t3w94Ye3Gt6E5KeHSoP8",
"network": "TRX",
"memo": "123123", //Optional
"fiatCurrency": "USD",
"amount": "100",
"orderType": "4", // Fixed to 4
"payWayCode": "10001",
"userAccountId": "12312", // Optional, must fill in for card payment and account
"redirectUrl": "http://payment.jyoumoney.com/alchemy/payResultPage/DZ02207121427022754",
"callbackUrl": "http://payment.jyoumoney.com/alchemyRamp/pay/callback?tradeNo=DZ02207091800356504"
}
Response Parameter Example (onramp):
{
"success": true,
"returnCode": "0000",
"returnMsg": "SUCCESS",
"extend": "",
"data": {
"orderNo": "onramp100001",
"webUrl": "https://www.google.com"
}
}
Request Parameter Example (offramp):
{
"side": "SELL",
"merchantOrderNo": "mer100001",
"cryptoCurrency": "USDT",
"network": "ETH",
"amount": "123.123", // Quantity of crypto being sold
"alpha2": "US",
"fiatCurrency": "USD",
"payWayCode": "10001",
"userAccountId": "12312",
"orderType": 6, // Fixed to 6
"callbackUrl": "http://payment.jyoumoney.com/alchemyRamp/pay/callback?tradeNo=DZ02207091800356504"
}
Response Parameter Example (offramp):
{
"success": true,
"returnCode": "0000",
"returnMsg": "SUCCESS",
"extend": "",
"data": {
"orderNo": "offramp100001",
"receivedAddress": "0xcbca4e794dcb053d0ca8a9cb666df44f56af7c38"
}
}
Updated 18 days ago