Appearance
How to Set Up a Telegram Stars Payment Bot
Quick Summary (TL;DR):
- Goal: Sell digital access (e.g., premium links, PDF downloads, private channel access) using Telegram Stars (XTR).
- Time to set up: ~5 minutes.
- Key Node needed: Payment Node (with currency set to
XTR). - Ready Template: ⚡ Import the Paid Access Solution Template
The Challenge: Why selling access in Telegram is hard with custom code
If you wanted to build a Telegram Stars payment bot using custom code (like Python's aiogram or Node.js gramY), you would have to:
- Register invoices manually via the Telegram Bot API using the
XTRcurrency code. - Set up an asynchronous listener for
pre_checkout_queryrequests and approve them within a strict 10-second window. - Manage database records to associate the payment with a specific Telegram User ID.
- Set up file delivery or generate temporary private channel invite links upon payment success.
Using TeleGo.io, you can achieve all of this visually. The visual scenario builder handles invoice delivery, transaction validation, and automatic user tagging out of the box.
Step-by-Step Implementation Flow
Here is the logic we will construct: User Clicks Buy ➔ Bot Sends Invoice (Stars) ➔ Payment Confirmed ➔ Bot Delivers Access Link
Step 1: Link your Bot to TeleGo
If you haven't connected your bot yet:
- Open Telegram and search for
@BotFather. - Send the
/newbotcommand, choose a name, and copy the HTTP API Token. - Open your TeleGo.io Dashboard, go to Bots, click Add New Bot, and paste the token.
Step 2: Create a Product in TeleGo
Before building the scenario, define what you're selling:
- Go to Workspace Settings → Integrations → Payments → enable Telegram Stars → Save.
- Go to Workspace Settings → Products & Payments → click Create Product.
- Choose Telegram Stars (XTR) as the provider.
- Fill in:
- Name: e.g., "Premium E-Book Access"
- Description: shown to users at checkout
- Price (Stars): e.g.,
50(≈ $0.02 per Star)
- Click Save.
Step 3: Add the Payment Card to Your Scenario
In TeleGo, payments happen inside a Message Node using the payment card type — there is no separate Payment Node:
- Open your scenario canvas and add a Message Node.
- Set the card type to payment.
- Select the product you created in Step 2.
- Connect the button's
nextlink (fires after successful payment) to an Actions Node:- Action:
tag.add→ e.g.,paid_premium
- Action:
- Connect the Actions Node to a Message Node that delivers the content:
"Thank you! Here is your invite link: https://t.me/+example-invite-link"
No failure branch needed
If the user cancels or doesn't have enough Stars, the payment sheet closes and the user stays on the same message — they can try again by clicking the button. The next link only fires on successful payment.
⚡ The Fast Track: Deploy in 1 Click
You don't need to configure these connections manually. You can load our pre-configured Paid Access template.
- Go to the TeleGo Template Gallery.
- Install the "Paid Access" template.
- Replace the placeholder invite link/file with your own, and click Publish. Your bot is ready to collect Stars immediately!
Frequently Asked Questions (FAQ)
Q: Does TeleGo charge a fee on Telegram Stars transactions?
A: No, TeleGo does not take a percentage cut of your Stars. Standard Telegram/Apple/Google processing fees apply (typically 30% cut taken by Telegram/App Stores, though Stars can be spent on ads or withdrawn via Fragment with lower fees).
Q: Can I use Stripe or PayPal instead of Stars?
A: Yes. If you are selling physical goods or in-person services, such as sessions at your studio, you can connect your Stripe account under Workspace Settings ➔ Integrations ➔ Payments and select Stripe (USD/EUR) inside the Payment Node instead of Telegram Stars.
(Note: Under Apple and Google App Store policies, digital goods delivered inside a Telegram bot must use Telegram Stars to comply with in-app purchase terms).