Bot Create Order
Introduction
This interface can be used when accessing Crypto Payment on telegram. ACH returns a web url and pulls up a page for user payment.
Regarding telegram bot, three usage modes are provided, depending on which front-end the merchant pulls up the payment page.
-
Browser mode: The merchant pulls up the weburl in the browser, and the payment page will be opened in the browser. After payment, it will jump to the redirectURL uploaded by the merchant
-
MINIAPP mode: The merchant pulls up the weburl in the miniapp, and the payment page will be embedded in the miniapp. The pop-up window will be closed after the payment is successful.(No need to uploaded redirectURL)
-
Bot mode: The merchant pulls up the ACH's bot, and jumps back to the merchant's bot after the payment is successful.
Path
Request Method:POST
Request Path:open/api/tg/payment/V2
Parameters
Request parameters
Parameter | Sign | Mandatory | Type | Length | Remarks |
---|---|---|---|---|---|
appId | Y | Y | string | 64 | AppId is uniqle for merchant |
merchantOrderNo | Y | Y | string | 64 | Customer transaction ID |
orderAmount | Y | Y | string | 64 | Order amount (amount unit: dollar) |
payCurrency | Y | Y | string | 64 | Currency of payment (EUR / USD) |
userId | Y | Y | string | 128 | UserId is uniqle for user (email / phone number) |
paymentTokens | Y | N | string | 128 | 1. Specify payment token, multiple tokens can be transferred 2. After transfer, users can only use the listed tokens for payment 3. Must be included in the merchant configuration token table 4. Will work on both coin payment and exchange Check on supported token list |
redirectURL | N | N | string | 512 | The redirection address after the successful purchase |
callbackURL | N | N | string | 512 | The address receiving order webhook |
customParam | N | N | string | 512 | Merchant custom parameters |
expiredTime | N | N | string | 32 | Time of expire (no more than 172800 second) Example:if the order expires in 1 hour, please upload 3600. |
payType | N | N | string | 32 | Type of payment |
paymentNetworks | N | N | string | 32 | Specify payment network(separated by comma) Check on supported token list |
orderModel | N | N | string | 32 | Order mode (ORDER/RECHARGE) capital letter required |
tgModel | N | N | string | 32 | *ONLY SUPPORT SANDBOX ENVIRONMENT Telegram front-end display mode: BROWSER/MINIAPP/BOT |
“customParam”: Extension parameter (required when tgModel is set to BOT)
Parameter | Sign | Mandatory | Type | Remarks |
---|---|---|---|---|
botName | N | N | string | bot user name |
chatId | N | N | string | user tg chatId |
orderDetail | N | N | string | Order description |
Payment Methods
Payment Method | Payment Method Code |
---|---|
QR Code Payment | WALLET |
Binance Pay | BINANCE_PAY |
Telegram Front-end Display Mode
Mode | Name | Difference of WebURL | Difference of RedirectURL |
---|---|---|---|
BROWSER | Browser Mode | webUrl payment http address | redirectURL: Redirect to Merchant address after payment completed |
MINIAPP | Pop-up mode | webUrl payment http address | redirectURL: Directly close the pop-up |
BOT | Jump to payment bot mode | webUrl payment bot address | redirectURL: Redirect to Merchant bot address after payment completed |
Request Example
{
"appId": "6fdbaac2********5ad705e9293",
"callbackURL": "https://crypto-payment-sbx.alchemy.cc/crypto/bot/cpCallback",
"customParam": "{\"botName\":\"ABCDCryptoPaymentTestBot\",\"orderDetail\":\"ABDC Test BAG 🎒\",\"chatId\":\"68*****61\"}",
"expiredTime": "999999",
"merchantOrderNo": "17243134568514",
"orderAmount": "10",
"orderModel": "ORDER",
"payCurrency": "USD",
"sign": "TEST000001",
"tgModel": "MINIAPP",
"userId": "51*****[email protected]"
}
Description of Response Parameters
Parameter | Type | Details |
---|---|---|
success | boolean | Success |
error | boolean | Error |
code | long | Response code |
msg | string | Response message |
traceId | string | Trace id |
model | object | Response details |
Response Example
{
"code": "0",
"model": {
"orderNo": "300217243809185440066",
"webUrl": "https://sbx-crypto-payment.alchemypay.org?orderNum=300217243809185440066"
},
"msg": "success",
"traceId": "66c7f6f6f7e8c1827f4fe27905f96546"
}
Updated 19 days ago