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:

Parameter

Mandatory

Type

Remarks

side

Y

string

Pass value: BUY

merchantOrderNo

Y

String

The merchant's custom order number and the merchant needs to guarantee it is unique.

amount

Y

String

The purchase amount of fiat currency(must be in uppercase),You can check the list of fiat currencies supported by Alchemy Pay Click Here

fiatCurrency

Y

string

Fiat code, USD/EUR, etc.

cryptoCurrency

Y

string

Crypto name, type in capital letter
Example: USDT

depositType

Y

int

Fixed value 2

address

Y

string

The address where the user receives the digital currency

network

Y

string

Crypto acquiring network: eg: ETH/BSC
Query supported crypto and network

payWayCode

Y

string

Payment method code: For the specific value, please refer Click Here

redirectUrl

N

string

The redirection address after the successful purchase of coins

callbackUrl

N

string

Callback address after a successful purchase

memo

N

string

Note: some networks require the memo field to be uploaded. Please refer Click Here

failRedirectUrl

N

string

The page redirect address after the coins purchase fails, if not passed in, the payment failure will also jump to the redirect URL

merchantName

N

string

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