API Integration

Description

If you want user can pass the process of fiat payment type chosen, email login, payment method chosen, and direct to the checkout page, you can use this API to acquire an URL that user can redirect to this step to make a payment.

15 minutes timeout

Test environment

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

Production environment

https://openapi-nft.alchemypay.org/nft/openapi/trade/order

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 TypeRemark
fiatYstringFiat type, char code with ISO4217 encoding currency unit, USD/EUR/SGD/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🔺
cryptoCstringBTC/ETH.etc ETH default. Required parameter for crypto-based🔺
cryptoAmountCstringTotal NFT oder crypto amount,Required parameter for crypto-based🔺
typeYstringNFT type: MARKET/MINT
uniqueIdCstringNFT Unique Identity, Required for NFT type MARKET 🔺
quantityCstringNFT 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
pictureCstringNFT pic rendering URL, 220px * 220 px

Http request --sample

//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",
}

Http response --sample

{
    "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"  //支付跳转地址
    }
}