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

https://openapi-test.alchemypay.org/merchant/trade/create

Prod environment

https://openapi.alchemypay.org/merchant/trade/create

Http method

  • POST
  • Content-Type: application/json

Http header

ElementMandatoryData TypeRemarks
access-tokenYstringaccessToken from Fetch Token API
appIdYstringPartner unique ID, once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with appId and appSecret
timestampYstringUTC time with 13 digit to represent time in milliseconds, expiration period is 5 minutes.
signYstringSHA1(appId + appSecret + timestamp), please refer to Sign demo for Initiate API

Http body

ElementMandatoryData TypeRemarks
sideYstringBUY or SELL(upcase, SELL is not yet supported)
merchantOrderNoNstringmerchant defined order ID,required when
fixedFee&feeRate/networkFee exist.
amountYstringfiat amount, unit in Dollar, Won, Yen, etc (VND and IDR must be integer)
fiatCurrencyYstringfiat type, char code with ISO4217 encoding(currently there are four currency USD, EUR, JPY, GBP)
cryptoCurrencyYstringcrypto type, e.g: ETH, please refer to Crypto Query API
depositTypeYintfixed value with 2
addressYstringreceived address
networkYstringcrypto network: e.g: ETH/BSC/BTC, please refer to Crypto QueryAPI
payWayCodeYstringGet from Fiat Query
alpha2Ystringcountry code with two letters defined in ISO 3166-1
redirectUrlNstringredirect URL after crypto transfer to end user’s address successfully
callbackUrlNstringcallback URL when crypto transfer to end user’s address successfully
memoNstringfor XRP and BNB(BEP2 network) , this is a necessary parameter
failRedirectUrlNstringredirect URL in case crypto buying failed
merchantNameNstringmerchant'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)