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:

ParameterRequiredTypeDescription
access-tokenYstringToken for no-login access, obtained from the no-login token API
appidYstringUnique identifier for the application
timestampYstringCurrent UTC 13-digit timestamp, valid for 5 minutes
signYstringSignature, refer to here

Body Parameters:

ParameterRequiredTypeDescription
sideYstringonramp: BUY / offramp: SELL
merchantOrderNoYstringCustom order number from the merchant; the merchant guarantees that the order number is unique.
amountYstringonramp: 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.
fiatCurrencyYstringName of the fiat currency, e.g., USD/EUR
alpha2NstringISO 3166-1 two-letter country code, such as US/JP, etc. Required for offramp
cryptoCurrencyYstringCrypto name, type in capital letter
Example:USDT
orderTypeYstringonramp: 4 / offramp: 6
addressNstringRequired for onramp; the address for the user to receive cryptocurrency
networkYstringCrypto receiving network: e.g., ETH/BSC/BTC
payWayCodeYstringPayment method code(credit card:10001, apple pay:501, google pay:701); specific values can be referenced from the payment method form query
userAccountIdNstringUser userAccountId obtained from the form submission interface
redirectUrlYstringonramp: Redirect address after successful purchase
callbackUrlYstringCallback address
memoNstringTo be filled according to network or platform requirements.Please refer Click Here
extendParamsNobjectRequired for credit card payments (payWayCode=10001). For details on how to obtain, refer to Get cookie for credit card payment
└─channelCookieNstringChannel Cookie
└─ cookieNstringRisk Control Cookie
clientIpYstringUser's IP (IPV4)

Request Parameter Example (onramp):

{
    "side": "BUY",
    "merchantOrderNo": "mer100001",
    "cryptoCurrency": "USDT",
    "address": "TSx82tWNWe5Ns6t***",
    "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://google.com/alchemy/payResultPage/DZ02207121427022754",
    "callbackUrl": "http://google.com/alchemyRamp/pay/callback"
}

Response Parameter Example (onramp):

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

Response Parameter Example (onramp-QRIS):

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "orderNo": "1393135310930825216",
        "qrCode": "00020101021226610016ID.CO.SHOPEE.****"
    },
    "traceId": "6870c056ee9707c8bcbad2adf87ddda3"
}

Response Parameter Example (onramp-VA):

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "orderNo": "1393135564782686208",
        "bankName": "VA BRI",
        "accountNumber": "13033***"
    },
    "traceId": "6870c0931309ecd3e4d7f2ffc2f4b456"
}

Response Parameter Example (onramp-PayID):

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "orderNo": "1393139009753305088",
        "referenceNumber": "522***",
        "payId": "[email protected]"
    },
    "traceId": "6870c3c88dd61f975f3359b54ad54fb2"
}

Response Parameter Example (onramp-Australian Bank Transfer):

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "bsb": "840400",
        "orderNo": "1391991764944924672",
        "accountName": "Company Name",
        "referenceNumber": "51***",
        "accountNumber": "3***"
    },
    "traceId": "686c974d716f830d85325fb6f44da9a7"
}

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=***"
}

Response Parameter Example (offramp):

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "orderNo": "139***",
        "receivedAddress": "0xcbca***"
    }
}