API Integration

Introduction

  • API mode support redirect user to the checkout page and skip other process.This api returns a checkout url and user can make a payment directly.
  • Order will be timeout in 15 minutes.

API Description

Request Method: POST

Test Request Path: https://api-nft-sbx.alchemytech.cc/nft/openapi/trade/order

Production Request Path: https://openapi-nft.alchemypay.org/nft/openapi/trade/order

Request Parameters

Header Parameters:

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

Body Parameters:

ElementMandatoryData TypeRemark
fiatYstringFiat type, char code with ISO4217 encoding currency unit, USD/EUR/JPY/GBP, etc. Required parameter for fiat-based🔺
amountYstringTotal NFT order fiat amount. The payment channel fee that the user needs to pay will be deducted from the amount. Required parameter for fiat-based🔺
cryptoNstringBTC/ETH.etc ETH default. Required parameter for crypto-based🔺
cryptoAmountNstringTotal NFT oder crypto amount,Required parameter for crypto-based🔺
typeYstringNFT type: MARKET/MINT
uniqueIdNstringNFT Unique Identity, Required for NFT type MARKET 🔺
quantityNstringNFT quantity, Required for NFT type MINT 🔺
payWayCodeYstringPayment method code, acquired from the fiat query API
redirectUrlYstringRedirect URL after buying NFT succeed
callbackUrlYstringWebhook URL to get the notify message from Alchemy Pay
merchantOrderNoYstringMerchant defined order ID
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
nameYstringNFT name
pictureNstringNFT pic rendering URL, 220px * 220 px

Request Parameter Example:

//fiat-based
{
    "side": "BUY",
    "fiat": "USD",
    "amount": "888",
    "type": "MARKET",
    "picture": "https://alchemypay.org",
    "name": "nftName",
    "uniqueId": "#1231",
    "redirectUrl": "https://alchemypay.org",
    "callbackUrl": "https://alchemypay.org",
    "payWayCode": "10001",
    "merchantOrderNo": "MER200000001",
    "appId": "qwjelqjelqkwje"
}
//crypto-based
{
    "side": "BUY",
    "fiat": "USD",
    "type": "MARKET",
    "name": "nftName",
    "picture": "https://alchemypay.org",
    "uniqueId": "#1231",
    "redirectUrl": "https://alchemypay.org",
    "callbackUrl": "https://alchemypay.org",
    "payWayCode": "10001",
    "merchantOrderNo": "MER200000001",
    "appId": "qwjelqjelqkwje",
    "crypto": "ETH",
    "cryptoAmount": "0.02",
}

Response Parameter Example:

{
    "success": true,
    "returnCode": "0000",
    "returnMsg": "SUCCESS",
    "extend": "",
    "data": {
        "orderNo":"945628891261980032",
        "payUrl": "https://nft-test.alchemytech.cc/#/paymentMethod?token=ACH3430784095ACHyE0n0PobCLqH0i%2BsiCjLI%2FbXSCg756UApqylZ8%2Fy0Xxcu14QzZlUY%2Fg3zSHEVd84mUzLIbUF2Bdg5dLz4hTyMA%3D%3D&email=D%2F6dKirEszZ2qmEOA5L93X5hCnimXkw6bTQVo92ScdR6HmiSbViNxaYB18X9IfnX&orderNo=1044205847647412224&id=EGPDNKKDygNT5vgBzYVwsA%3D%3D" //checkout url
    }
}