Create Order

Introduction

This API can only be invoked on the server side.

API Description

Request Method: POST

Request Path:/open/api/v4/merchant/trade/create

Request Parameters

Header Parameters:

ParameterMandatoryTypeRemarks
access-tokenYstringLogin-free accessToken value, which can be obtained from the access token interface
appIdYstringApp unique identifier
timestampYstringCurrent UTC 13-digit timestamp, valid within 5 minutes
signYstringSignature, you can refer to the signature Click Here

Body Parameters:

ParameterMandatoryTypeRemarks
sideYstringPass value: BUY
merchantOrderNoYStringMerchant Order ID (Unique)
amountYStringThe purchase amount of fiat currency
fiatCurrencyYstringFiat code (Uppercase), Query supported Fiat
Example:USD/EUR, etc.
cryptoCurrencyYstringCrypto name (Uppercase) Example: USDT
depositTypeYintFixed value 2
addressYstringUser’s wallet address
networkYstringCrypto acquiring network: eg: ETH/BSC
Query supported crypto and network
payWayCodeYstringPayment method code: Query supported payWayCode
redirectUrlNstringThe redirection address after the successful purchase of coins
callbackUrlNstringCallback URL for receiving webhook, Order status that trigger webhooks
memoNstringNote: some networks require the memo field to be uploaded. Please refer Click Here
failRedirectUrlNstringThe page redirect address after the coins purchase fails, if not passed in, the payment failure will also jump to the redirect URL
merchantNameNstringMerchant name, if passed in, the merchant name will be displayed on the payment result page

Request Parameter Example:

{
    "side": "BUY",
    "cryptoCurrency": "USDT",
    "address": "0x3E544857595654Ab***********",
    "network": "BSC",
    "fiatCurrency": "AUD",
    "amount": 50,
    "merchantOrderNo": "20259221************",
    "depositType": 2,
    "payWayCode": "501",
    "redirectUrl": "https://ramp.***pay.io/order?merchantOrderNo=20259221***********&redirectUrl=https%3A%2F%2Fwww.ABC.net",
    "callbackUrl": "https://api.ramp.***pay.io/order/callback/alchemypay?merchantOrderNo=202592215**********"
}

Response Parameters

ParameterTypeDescription
successbooleanIndicates whether the request was successful
returnCodestringResponse status code. See Return Code List
returnMsgstringDescription of the response status code
extendstringReserved field
dataobject
└─orderNostringOrder number
└─ payUrlstringPayment URL. The user can use this link to proceed to the payment page.
traceIdstringUnique identifier for request tracing and debugging. Provide this when issues occur.

Response Parameters Example(Success):

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "orderNo": "1430459042606*******",
        "payUrl": "https://ramp.alchemypay.org/#/paymentMethod?token=ACH2906612342%40ACH%40ee6Y3HTKu8O***********************&email=OaViuSG0Be%2BpIiW8%2B%2F49Vr5f9EcgrP7NXDEfVpSVaDc%3D&orderNo=143045904260*******&id=ee6Y3HTKu8O********L8A%3D%3D&cardFlag=false"
    },
    "traceId": "68f888cc0ebd6a3754c3494b90eefce3"
}

Response Parameters Example(Error):

{
    "success": false,
    "returnCode": "3103",
    "returnMsg": "Please refresh timestamp",
    "extend": "",
    "data": null,
    "traceId": "64ed9681618806b022dd303e2ea1ed13"
}