Create Order

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
amountYstringfiat amount, unit in Dollar, Won, Yen, etc
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
addressYstringcrypto address
networkYstringcrypto network: e.g: ETH/BSC/BTC, please refer to Crypto Query API
payWayCodeYstringfixed value with 10001
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
merchantFixedFeeNstringmerchant defined fixed fee, two decimals maximum, unit in Dollar, Won, Yen, etc, need to work with merchantFeeRate together
merchantFeeRateNstringmerchant defined rate, four decimals, need to work with merchantFixedFee together. e.g. 0.03 mean 3%
merchantNetworkFeeNstringmerchant defined network fee, two decimals maximum, in Dollar, Won, Yen, etc
memoNstringfor XRP and BNB(BEP2 network) , this is a necessary parameter
failRedirectUrlNstringredirect URL in case crypto buying failed

Request sample - Header

622622

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 rendering payUrl into your website or H5 page(sample as below), end user just input card necessary details to trigger the fiat payment.

payUrl rendering sample

326326