Price Query

Description

The number of crypto currencies purchased is calculated based on the amount of incoming fiat currency, and the number returned may differ from the actual number received.

Test environment

https://openapi-test.alchemypay.org/merchant/order/quote

Prod environment

https://openapi.alchemypay.org/merchant/order/quote

Http mothod

  • POST
  • Content-Type: application/json

Http header

ElementMandatoryData TypeRemarks
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
cryptoYstringcrypto type, e.g: ETH, please refer to crypto query API
networkNstringcrypto network
fiatYstringfiat type, char code with ISO4217 encoding(currently there are four currency USD, EUR, JPY, GBP)
countryNstringcountry code with two letters defined in ISO 3166-1
amountYBigdecimalfiat amount, Unit in Yuan, should be between payMin and payMax of Fiat Query API output
payWayCodeNstringpayment method code, for side=BUY only
sideYstringBUY
SELL
typeCstringONE(by default)
ALL
for side=BUY only

Request sample - Header

728728

Request sample - Body

{
    "crypto": "USDT",
    "network": "ETH",
    "fiat": "USD",
    "country": "US",
    "amount": "100",
    "payWayCode": "10001",
    "side": "BUY"
    “type": "ONE"
}

Response sample

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "crypto": "USDT", //crypto type
        "cryptoPrice": "1.0001", //crypto price
        "cryptoQuantity": "100.11", //estimated crypto amount can be purchased
        "fiat": "USD", //fiat currency
        "rampFee": "4.93", //estimated ramp fee 
        "networkFee": "0.29" //estimated network fee
    }
}

Request sample - Body

{
    "crypto": "USDT",
    "network": "TRX",
    "fiat": "IDR",
    "amount": "520000",
    "side": "BUY",
    "type": "ALL"
}

Response sample

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": [
        {
            "cryptoPrice": "15701.40",
            "rampFee": "13000.00",
            "cryptoQuantity": "31.49011425",
            "networkFee": "12561.12",
            "fiat": "IDR",
            "crypto": "USDT",
            "payWayCode": "10004"
        },
        {
            "cryptoPrice": "15701.40",
            "rampFee": "13800.00",
            "cryptoQuantity": "31.43916338",
            "networkFee": "12561.12",
            "fiat": "IDR",
            "crypto": "USDT",
            "payWayCode": "10003"
        },
        {
            "cryptoPrice": "15701.40",
            "rampFee": "19200.00",
            "cryptoQuantity": "31.09524500",
            "networkFee": "12561.12",
            "fiat": "IDR",
            "crypto": "USDT",
            "payWayCode": "10006"
        },
        {
            "cryptoPrice": "15701.40",
            "rampFee": "19200.00",
            "cryptoQuantity": "31.09524500",
            "networkFee": "12561.12",
            "fiat": "IDR",
            "crypto": "USDT",
            "payWayCode": "10005"
        }
    ],
    "traceId": "637b02c461bb30facc0cd80c73baba22"
}