Guide: connecting a payment API to a Telegram bot
Connect a payment API to your bot: Click/Payme/SBP integration, StarsPaymee API key, order and webhook. 24/7 automated sales — step by step and 18 Q&A.
To connect a payment API to your Telegram bot: set up a payment integration (Click/Payme/SBP), create orders with the StarsPaymee API key and get the status via webhook. The customer picks a product in the bot, pays, and Stars/Premium/Gift is delivered automatically — all inside the bot.
Why does a bot need a payment API?
In manual selling an admin checks every payment and delivers by hand — slow and error‑prone. With a payment API the bot works on its own: it accepts payment, confirms and delivers. This gives 24/7 automated sales.
- Payment integration — Click, Payme or SBP.
- StarsPaymee API key — for product delivery.
- Webhook — for payment and delivery status.
- Order database — ID, status, customer.
Step‑by‑step connection
- 1. Bot and API keyCreate a bot (BotFather) and get an API key from StarsPaymee Business.
- 2. Catalog and priceUse
GET /productsto display products and prices in the bot. - 3. Create a paymentWhen the customer chooses, create a Click/Payme/SBP invoice and give the link.
- 4. Callback/webhookOn payment confirmation, send the order via
POST /orders. - 5. Deliver and notifyAfter the «delivered» webhook, show the customer a confirmation in the bot.
Want to connect a payment API to your bot? Contact Business.
@StarsPaymee_botRelated: Stars API, Click callback, webhook and payment API.
- core.telegram.org/bots/api — Bot API
- core.telegram.org/bots/payments — bot payments
Frequently asked questions
How do I connect a payment API to a bot?
Which payment methods?
Where do I get the API key?
How do I display the catalog?
Does the product ship automatically after payment?
Is a webhook mandatory?
Do I need a bot library?
Is there a Sandbox?
What matters for security?
Does it work with Mini App?
Do I need an order database?
How about refunds?
Can I sell in rubles?
Can I sell multiple products?
Is there statistics?
Is documentation provided?
Is there support?
How do I start?
Automate your bot
Through StarsPaymee Business, connect a payment API to your bot — 24/7 automated sales.
Open the botRelated articles
Can a Bot Widget Take Stars Payments? Storefront, Invoice and TON Requests
A widget can serve as a storefront, but a separate invoice is the better way to collect Stars. This article covers widget limits, steps for updating prices and how a TON wallet request affects buyer trust.
ReadRich messages and Stars payments: can a bot’s catalog include an invoice?
Yes, a rich message can be your catalog and price table, but take Stars payments with a separate invoice. The docs don’t show how to attach one. Inside: a table of blocks and a 6-step sales flow.
ReadStop Spam Accounts Joining Your Telegram Group: AI Guardian or Stars?
The main way to stop spam at the door is to require join requests and let an AI guardian bot screen them. Stars barriers are an extra filter. Inside: a comparison table, setup steps and test examples.
Read
