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
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 |
Http body
Element | Mandatory | Data Type | Remark |
---|---|---|---|
fiat | Y | string | Fiat type, char code with ISO4217 encoding currency unit, USD/EUR/SGD/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 | C | string | BTC/ETH.etc ETH default. Required parameter for crypto-based🔺 |
cryptoAmount | C | string | Total NFT oder crypto amount,Required parameter for crypto-based🔺 |
type | Y | string | NFT type: MARKET/MINT |
uniqueId | C | string | NFT Unique Identity, Required for NFT type MARKET 🔺 |
quantity | C | 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 | C | string | NFT 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" //支付跳转地址
}
}
Updated about 2 months ago