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:
Element | Mandatory | Data Type | Remarks |
---|---|---|---|
access-token | Y | string | accessToken from Fetch Token API |
appId | Y | string | Partner unique ID, once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with appId and appSecret |
timestamp | Y | string | UTC time with 13 digit to represent time in milliseconds, expiration period is 5 minutes. |
sign | Y | string | SHA1(appId + appSecret + timestamp), please refer to Sign demo for Initiate API |
Body Parameters:
Element | Mandatory | Data Type | Remark |
---|---|---|---|
fiat | Y | string | Fiat type, char code with ISO4217 encoding currency unit, USD/EUR/JPY/GBP, etc. Required parameter for fiat-based🔺 |
amount | Y | string | Total 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🔺 |
crypto | N | string | BTC/ETH.etc ETH default. Required parameter for crypto-based🔺 |
cryptoAmount | N | string | Total NFT oder crypto amount,Required parameter for crypto-based🔺 |
type | Y | string | NFT type: MARKET/MINT |
uniqueId | N | string | NFT Unique Identity, Required for NFT type MARKET 🔺 |
quantity | N | string | NFT quantity, Required for NFT type MINT 🔺 |
payWayCode | Y | string | Payment method code, acquired from the fiat query API |
redirectUrl | Y | string | Redirect URL after buying NFT succeed |
callbackUrl | Y | string | Webhook URL to get the notify message from Alchemy Pay |
merchantOrderNo | Y | string | Merchant defined order ID |
appId | Y | string | Partner unique ID, once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials with appId and appSecret |
name | Y | string | NFT name |
picture | N | string | NFT 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
}
}
Updated 11 days ago