Telegram bot crypto payments: add crypto payment to your bot
Telegram bot crypto payments: how to add crypto payment to a Telegram bot, what the planned Qvard checkout is and the working path with the API today.
A Telegram bot with crypto payments takes an order in the chat and sends the customer a payment button. Qvard plans a native Telegram checkout, and it is not released yet. This guide shows how to add crypto payment to a bot today with the live API, the hosted page and the webhook.
What the bot needs to do
The bot collects the order, creates a payment on your backend, sends the customer the button and waits for the webhook. The chat is the storefront, while the payment itself happens on the hosted page.
Status: the native bot checkout is on the roadmap
A native Qvard checkout for Telegram bots is not released yet, and this article does not describe it as available. The integration below works today with the existing API.
x-api-key: sk_live_…
{
"id": "order_1024",
"price": 149.99,
"paymentSystemId": 12
}
// 201 Created
{
"data": {
"id": "8f3k2a1c",
"redirectUrl": "https://my.qvard.com/pay/8f3k2a1c"
},
"code": 201,
"message": "success",
"status": true
}The payment call from the bot backend
The bot backend sends POST /api/v1/payment with the x-api-key header, the order id in id and the total in USD in price. The response contains the redirectUrl, which becomes the button.
The button and the order message
Send one message with the order, the amount and the button to the redirectUrl. Keep the message short, and do not promise delivery or access until the webhook confirms the payment.
Receive the status on your backend
Your webhook endpoint receives id and status, checks the x-api-key header and updates the order. Only the paid status should unlock the product or the service.
x-api-key: sk_live_…
{ "id": "order_1024", "status": "paid" }Handle the repeats and the failures
If the customer closes the page, the order stays pending and the bot can offer the same payment link again. Make the webhook handler safe to repeat, because the same message can arrive twice.
FAQ
Can a Telegram bot take crypto payments today?
Yes. The bot creates a payment with the API, sends a button to the redirectUrl and confirms the order from the webhook. The native Telegram checkout is on the roadmap.
Do I need a special bot framework?
No. Any bot code that can call an HTTPS endpoint and receive a webhook can create payments through the API.
Where should the API key be stored?
On the bot backend only. Never put the key in the chat messages or in code the customer can see.
How do I test the bot payment?
Create a demo invoice from a test order, pay it on the hosted page and check that the bot receives the webhook.
