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:
| Parameter | Mandatory | Type | Remarks |
|---|---|---|---|
| access-token | Y | string | Login-free accessToken value, which can be obtained from the access token interface |
| appId | Y | string | App unique identifier |
| timestamp | Y | string | Current UTC 13-digit timestamp, valid within 5 minutes |
| sign | Y | string | Signature, 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; the number of digits needs to be controlled according to the precision of the fiat currency. A precision of 0 means an integer and a precision of 2 means two decimal places. For accuracy, please refer to Basic Data - Legal Currency and Payment Method |
| 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/BSCQuery 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
| Parameter | Type | Description |
|---|---|---|
| success | boolean | Indicates whether the request was successful |
| returnCode | string | Response status code. See Return Code List |
| returnMsg | string | Description of the response status code |
| extend | string | Reserved field |
| data | object | |
| └─ orderNo | string | Order number |
| └─ payUrl | string | Payment URL. The user can use this link to proceed to the payment page. |
| traceId | string | Unique 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"
}
Updated 14 days ago