Business

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.

Short answer

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.

Required parts
  • 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. 1. Bot and API keyCreate a bot (BotFather) and get an API key from StarsPaymee Business.
  2. 2. Catalog and priceUse GET /products to display products and prices in the bot.
  3. 3. Create a paymentWhen the customer chooses, create a Click/Payme/SBP invoice and give the link.
  4. 4. Callback/webhookOn payment confirmation, send the order via POST /orders.
  5. 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_bot

Related: Stars API, Click callback, webhook and payment API.

Frequently asked questions

How do I connect a payment API to a bot?
Set up payment (Click/Payme/SBP), create orders via the StarsPaymee API and get the status via webhook.
Which payment methods?
Click, Payme, UzCard/HUMO (so‘m) and SBP (rubles).
Where do I get the API key?
Submit a request on the StarsPaymee Business page.
How do I display the catalog?
Use GET /products to fetch products and price and show them in the bot.
Does the product ship automatically after payment?
Yes. After confirmation it's sent via POST /orders and delivered automatically.
Is a webhook mandatory?
Recommended — for real‑time status; there's a status request as a fallback.
Do I need a bot library?
Any (aiogram, telegraf, grammY, etc.) — since the API is REST.
Is there a Sandbox?
Yes. A test environment with no real money.
What matters for security?
Keep the key server‑side, verify the signature and use idempotency.
Does it work with Mini App?
Yes. Both in the bot and in the Mini App.
Do I need an order database?
Yes. A small database for ID, status and customer is useful.
How about refunds?
An undelivered order is refunded per the settlement policy.
Can I sell in rubles?
Yes. Via the SBP integration.
Can I sell multiple products?
Yes. Stars, Premium, Gifts through one API.
Is there statistics?
Yes. Orders and payments by ID.
Is documentation provided?
Yes. With endpoint, callback and webhook examples.
Is there support?
Yes, @StarsPaymeeSupport.
How do I start?
Submit a request on the StarsPaymee Business page.

Automate your bot

Through StarsPaymee Business, connect a payment API to your bot — 24/7 automated sales.

Open the bot