Create Order Bot (Telegram)

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.

  1. 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
  2. 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)
  3. Bot mode: The merchant pulls up the ACH's bot, and jumps back to the merchant's bot after the payment is successful.

API Description

Request Method:POST

Request Path:open/api/tg/payment/V2

Parameters

Request parameters

ParameterSignMandatoryTypeLengthRemarks
appIdYYstring64AppId is uniqle for merchant
signNYstring256sign
merchantOrderNoYYstring64Customer transaction ID
orderAmountYYstring64Order amount (amount unit: dollar)
example: 1=1.00
payCurrencyYYstring64Currency of payment (EUR / USD)
userIdYYstring128UserId is uniqle for user (email / phone number)
paymentTokensYNstring1281. 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
redirectURLNNstring512The redirection address after the successful purchase
callbackURLNNstring512The address receiving order webhook
customParamNNstring512Merchant custom parameters
expiredTimeNNstring32Time of expire (second)
payTypeNNstring32Type of payment
paymentNetworksNNstring32Specify payment network(separated by comma)
orderModelNNstring32Order mode (ORDER/RECHARGE) capital letter required
tgModelNNstring32Telegram front-end display mode: BROWSER/MINIAPP/BOT

Telegram Front-end Display Mode

ModeNameDifference of WebURLDifference of RedirectURL
BROWSERBrowser ModewebUrl payment http addressredirectURL:
Redirect to Merchant address after payment completed
MINIAPPPop-up modewebUrl payment http addressredirectURL:
Directly close the pop-up
BOTJump to payment bot modewebUrl payment bot addressredirectURL:
Redirect to Merchant bot address after payment completed

Payment Methods

Payment MethodPayment Method Code
QR Code PaymentWALLET
Binance PayBINANCE_PAY

Request Example

{
    "appId": "6fdbaac29eb94bc6b12345ad705e9293",
    "callbackURL": "https://crypto-payment-sbx.aeon.cc/crypto/bot/cpCallback",
    "customParam": "{\"botName\":\"ABCDCryptoPaymentTestBot\",\"orderDetail\":\"ABDC Test BAG 🎒\",\"chatId\":\"6831529261\"}",
    "expiredTime": "999999",
    "merchantOrderNo": "17243134568514",
    "orderAmount": "10",
    "orderModel": "ORDER",
    "payCurrency": "USD",
    "sign": "TEST000001",
    "tgModel": "MINIAPP",
    "userId": "[email protected]"
}

Description of Response Parameters

ParameterTypeDetails
successbooleanSuccess
errorbooleanError
codelongResponse code
msgstringResponse message
traceIdstringTrace id
modelobjectResponse details

Response Example

{
    "code": "0",
    "model": {
        "orderNo": "300217243809185440066",
        "webUrl": "https://sbx-crypto-payment.aeon.org?orderNum=300217243809185440066"
    },
    "msg": "success",
    "traceId": "66c7f6f6f7e8c1827f4fe27905f96546"
}