How payments work in Telegram bots: when to use Stars, how the invoice and checkout flow runs, how to verify and refund payments, and common pitfalls.
Telegram bots take payments through Telegram's built-in payments system. For digital goods and services, Telegram's rules generally require payment in Telegram Stars; for physical goods, bots can use supported third-party payment providers. In both cases the flow is the same shape: your bot sends an invoice, confirms the order when Telegram asks, and delivers once Telegram reports a successful payment.
This guide explains the concepts and the order of events in plain language. It does not replace Telegram's official Bot API documentation, which you should read for exact method names, fields and current rules.
The first decision is which kind of payment you need. Telegram's rules here have changed over time, so check the current developer terms before building.
Telegram Stars are Telegram's own currency. Users buy them inside Telegram and spend them in bots and Mini Apps. For digital goods and services sold in a bot or Mini App, such as premium features, content, in-app items or access, Telegram generally requires Stars.
For developers, Stars have practical advantages:
For a user-level overview, see Telegram Stars Explained.
For physical goods and some services, a bot can connect a supported third-party payment provider through @BotFather. The provider processes the card or other payment, and Telegram passes the result to your bot. Which providers are available depends on region and changes over time, so check BotFather's current options.
Whether you use Stars or a provider, the sequence is broadly the same. Here it is in order.
Before sending anything to the buyer, record the order in your own system. Note what is being bought, the price, the currency and who is buying. Give the order an identifier that only you control.
This record matters. Later, you will check every payment against it.
Your bot sends an invoice message to the buyer, or creates an invoice link to share or open from a Mini App. The invoice includes a title, a description, the price and a payload.
The payload is a piece of data your bot receives back when the buyer pays. Use it to carry your order identifier and nothing else. Do not put the price or product details in it, because your server should look those up from its own record, not trust what comes back.
Telegram shows its own payment screen. For Stars, the buyer confirms with their Stars balance. For a provider, they enter payment details with the provider. Your bot never sees card numbers.
Before money moves, Telegram sends your bot a pre-checkout query. This is your one chance to say yes or no before the charge.
Your bot must answer quickly. Telegram allows only a short time, so keep this check fast. If you do not answer in time, the payment fails.
At this step, check:
If anything is wrong, decline with a short, clear reason. Declining here costs the buyer nothing. Declining after payment means a refund.
Once the payment goes through, your bot receives a message saying the payment succeeded. It includes a charge identifier from Telegram, and for providers an identifier from the provider too.
Store these identifiers with the order before you do anything else. You need them to issue refunds and to answer support questions.
Mark the order as paid and deliver what was bought: unlock the feature, send the file, or confirm the shipment. Then tell the buyer what happened.
Payments are where small bugs cost real money and trust. A few principles help.
Telegram can deliver the same update more than once. When the successful payment message arrives, check that the order is not already marked as paid before you deliver. Make the "mark as paid" step a single conditional update, so two copies of the same message cannot both succeed.
The price and product should always come from your database, written before the invoice existed. Treat the payload and any client-side information as a pointer, never as the truth about what was bought.
If you open an invoice from a Mini App, the app may receive a status when the payment screen closes. That is a user-interface event, not proof of payment. Only the successful payment message to your bot counts. Use the callback to update the screen, for example to show "confirming", and nothing more.
The pre-checkout answer must be fast. Avoid slow database queries, outside calls or heavy work at that step. Do the minimum check needed to say yes or no.
Telegram provides a way for bots to refund Stars payments, using the charge identifier from the successful payment. For provider payments, refunds usually go through the provider.
Plan refunds from the start:
Telegram's rules for bots that sell things also expect buyers to be able to get support. Check the current developer terms for what you must provide.
Developers who earn Stars can convert them under Telegram's current rules, which have involved Fragment and TON. The process, waiting periods and conditions can change, so check Telegram's official information and Fragment before you plan around it.
Nothing in this guide is financial or tax advice. Income from Stars or crypto may be taxable where you live. See Telegram Income Taxes for Creators for general information, and check local rules or a professional.
Telegram offers a test environment for bots and some providers offer test modes. Use them before going live. Test the unhappy paths too: a declined pre-checkout, a duplicate success message, and a refund.
No. Stars payments are handled by Telegram. A third-party provider is only needed for payment types that use one, such as physical goods.
No. Card details go to the payment provider. Your bot receives only the payment result and identifiers.
The payment does not go ahead. The buyer is not charged, but they will see a failed payment, so keep that step fast and reliable.
Yes. Telegram provides a refund method for Stars that uses the charge identifier from the original payment. Store it with every order.
Yes. Telegram offers several Stars features for channels as well as bots. See Paid Telegram Channels Explained for an overview.
No. Stars are Telegram's in-app currency. Crypto payments work differently and carry their own risks and rules.
Telegram bot payments follow one pattern: record the order, send an invoice with an order identifier in the payload, check everything in the pre-checkout query, then store the charge identifier and deliver once a successful payment arrives. Use Stars for digital goods where Telegram requires it, and a supported provider for physical goods. Trust your own records, guard against duplicate updates, plan refunds early, and keep Stars separate in your accounts. Before building, read Telegram's official documentation and current terms. For bot basics, start with How to Create a Telegram Bot With BotFather.
Ownership confirmed through our claim process — not an endorsement of their content.
Founder of Telegram.
The official Telegram on Telegram. Much recursion. Very Telegram. Wow.
Telegram Premium – a subscription that unlocks dozens of exclusive features.
Binance Official English Group Binance Official Chinese Group Binance English Announcements Binance Chinese Announcements
is a modern crypto news and research platform covering the latest developments across digital assets, markets, regulation, and blockchain technology.
This channel focuses exclusively on what shapes global finance. Macroeconomics, markets, liquidity, central banks.
BlackBlock Markets exists to observe how capital moves before it becomes obvious.
Bitcoin is a global macro asset. This channel is dedicated to Bitcoin only.
Crypto Invest Next 100x. Admin