Create Order
Introduction
This interface is only for On Ramp scene
If you want to skip our homepage and address confirmation page and go directly to the cash register payment page, you can try this interface. Through the interface of creating an order, we will generate a payment link, and you need to redirect your users to this link to complete the payment.
It should be noted that if you use the method of creating an order, you need to fully confirm the user's email address, fiat currency, purchased digital currency, purchase amount, and payment method, which will be used when creating an order.
🟠 The payment URL is available for 24 hours.
Test environment
Prod environment
Http method
- POST
- Content-Type: application/json
Http header
Element | Mandatory | Data Type | Remarks |
---|---|---|---|
access-token | Y | string | accessToken from Fetch Token API |
appId | Y | string | Partner unique ID, once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with appId and appSecret |
timestamp | Y | string | UTC time with 13 digit to represent time in milliseconds, expiration period is 5 minutes. |
sign | Y | string | SHA1(appId + appSecret + timestamp), please refer to Sign demo for Initiate API |
Http body
Element | Mandatory | Data Type | Remarks |
---|---|---|---|
side | Y | string | BUY or SELL(upcase, SELL is not yet supported) |
merchantOrderNo | N | string | merchant defined order ID,required when fixedFee&feeRate/networkFee exist. |
amount | Y | string | fiat amount, unit in Dollar, Won, Yen, etc (VND and IDR must be integer) |
fiatCurrency | Y | string | fiat type, char code with ISO4217 encoding(currently there are four currency USD, EUR, JPY, GBP) |
cryptoCurrency | Y | string | crypto type, e.g: ETH, please refer to Crypto Query API |
depositType | Y | int | fixed value with 2 |
address | Y | string | received address |
network | Y | string | crypto network: e.g: ETH/BSC/BTC, please refer to Crypto QueryAPI |
payWayCode | Y | string | Get from Fiat Query |
alpha2 | Y | string | country code with two letters defined in ISO 3166-1 |
redirectUrl | N | string | redirect URL after crypto transfer to end user’s address successfully |
callbackUrl | N | string | callback URL when crypto transfer to end user’s address successfully |
memo | N | string | for XRP and BNB(BEP2 network) , this is a necessary parameter |
failRedirectUrl | N | string | redirect URL in case crypto buying failed |
merchantName | N | string | merchant's name, will be displayed in the result page if pass it |
Request sample - Body
{
"side": "BUY",
"cryptoCurrency": "USDT",
"address": "TSx82tWNWe5Ns6t3w94Ye3Gt6E5KeHSoP8",
"network": "TRX",
"fiatCurrency": "USD",
"amount": "100",
"depositType": 2,
"payWayCode": "10001",
"alpha2": "US",
"redirectUrl": "http://payment.jyoumoney.com/alchemy/payResultPage/DZ02207121427022754",
"callbackUrl": "http://payment.jyoumoney.com/alchemyRamp/pay/callback?tradeNo=DZ02207091800356504"
}
Response sample
{
"success": true,
"returnCode": "0000",
"returnMsg": "SUCCESS",
"extend": "",
"data": {
"orderNo": "1000974004706615296",
"payUrl": "https://ramptest.alchemypay.org?token=ACH7833164893ACHvJoJTBRF%2Fb1sUp0Hq9Amo8C8NdSYwK%2B5ldXCtRcGMqEDudadzZ14999bggdpJPBzxKLSe5XzCmdMNmETMjbong%3D%3D&email=O2Mp5tDOQk3hQFXPlQDBBUuJDUTklzdMujrrKM0XUbg%3D&orderNo=1000974004706615296&id=z1%2F%2FLCqqoEoYloBXVODzPg%3D%3D&cardFlag=false"
}
}
Please render payUrl into your website or H5 page (sample as below); the end user just inputs the necessary card details to trigger the fiat payment.
You can config the language setting by adding &language=es/zh-HK/en-US in the payUrl.
🔺🔺🔺Caution:
The crypto received address can only be used by single user(email)
Updated 15 days ago