The short answer: what you sell decides how you charge
Telegram requires bots that sell digital goods or services to charge in Telegram Stars (currency XTR, empty provider_token in sendInvoice). Physical goods can still go through third-party providers such as Stripe.
Both cases use the same Bot API methods: sendInvoice, createInvoiceLink, answerPreCheckoutQuery and the successful_payment message. What changes is two parameters and a handful of rules. Telegram's Stars guide puts the rule flatly: your bot "must use Telegram Stars for the sale of digital goods and services inside Telegram apps", and "all transactions must be carried out in Telegram Stars, with currency tag XTR". The Bot API reference describes provider_token as "Pass an empty string for payments in Telegram Stars".
| Digital goods and services | Physical goods and services | |
|---|---|---|
| Examples | Premium bot features, AI credits, paid content, subscriptions to a private channel | Clothing, food delivery, event tickets for a venue, an in-person appointment |
currency | XTR | A three-letter ISO 4217 code such as USD or EUR |
provider_token | Empty string (or omit it) | The token BotFather gives you for your provider |
prices | Exactly one item | A breakdown: product, tax, discount, delivery |
| Tips, shipping, name/phone/email | Not supported or ignored | Supported |
| Subscriptions | Yes, via subscription_period | No native recurring option |
| Refunds | refundStarPayment in the Bot API | Through your payment provider |
| Who processes the money | Telegram (users buy Stars in the app) | Your provider; Telegram only relays the payment |
The rest of this guide goes through each half in the order you will build it: the Stars invoice, the 10-second pre-checkout deadline, delivery, subscriptions, refunds, and then the provider path for physical goods. A troubleshooting table at the end covers the failures that come up most.
Why Telegram forces Stars for digital goods
Telegram's apps ship through the App Store and Google Play, and both stores have rules about how apps sell digital goods. Telegram's answer is Stars: users buy them through Apple or Google in-app purchases or through @PremiumBot, and bots charge in Stars. The Stars FAQ is explicit that this is not optional. Asked whether a bot can use a different currency or payment provider, it says no, and warns that Telegram may be unable to show mobile users a bot that sells digital goods any other way (Telegram, Bot Payments API for Digital Goods and Services).
Three follow-ups from the same FAQ settle the questions developers usually ask next:
- "I already sell on my own website. Do I still need Stars?" Yes. Sales of digital goods inside Telegram apps must use Stars, whatever you do elsewhere.
- "Can I take crypto instead?" No. Digital goods sold through bots and Mini Apps use Stars only.
- "Can I send people a link to my Stripe checkout?" For digital goods, that is a third-party provider by another route, and the FAQ's answer is the same: Stars only.
The Bot Platform Developer Terms make it contractual. Section 6.2 says digital goods and services sold through bots "must be executed exclusively through the exchange of Telegram Stars", while section 6.1 lets developers sell physical goods by interfacing "solely and directly with third-party payment providers".
The line between the two is about what the user receives. If the thing bought is delivered and used inside Telegram or another app, it is digital. If it ships, or the service happens in the physical world, it is physical. When you are unsure, read section 6 of the developer terms before you build, because a bot rejected for the wrong payment method has to be rebuilt anyway.
Sending a Stars invoice
A Stars invoice is a normal sendInvoice call with three differences: currency is XTR, provider_token is empty, and prices holds one item whose amount is a whole number of Stars.
curl -X POST "https://api.telegram.org/bot<TOKEN>/sendInvoice" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
"title": "Pro features, 30 days",
"description": "Unlimited exports and priority replies",
"payload": "order_8f3a21",
"provider_token": "",
"currency": "XTR",
"prices": [{ "label": "Pro, 30 days", "amount": 250 }]
}'The Bot API reference sets limits on each field, and the ones people trip over are:
title: 1-32 characters.description: 1-255 characters.payload: 1-128 bytes, "not displayed to the user". Put your own order ID here. It comes back in the pre-checkout query and insuccessful_payment, so it is how you match a payment to an order.prices: "Must contain exactly one item for payments in Telegram Stars". A tax line or discount line is an error in XTR.max_tip_amount: "Not supported for payments in Telegram Stars."need_name,need_phone_number,need_email,need_shipping_address,is_flexible: all "Ignored for payments in Telegram Stars." Telegram's Stars guide notes that buyers do not hand over personal details at all, so if you need an email address, ask for it in the conversation.
If you would rather post a payable link than an invoice message, for example from a Mini App or a button elsewhere, createInvoiceLink takes the same fields and returns a URL. For a bot it is also the only way to create a subscription, covered below.
One behaviour to decide on before launch: start_parameter. If you leave it empty, forwarded copies of the invoice keep a working Pay button, so anyone the message is forwarded to can pay the same invoice. If you set it, forwarded copies get a deep link to your bot instead. Shops usually want the second, so every buyer gets their own order.
The 10-second pre-checkout deadline
When the user taps Pay and confirms, Telegram sends your bot an update with a pre_checkout_query field. This is your last chance to say no: the item is sold out, the price changed, the order expired. The reference is strict about timing: "The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent". The payments guide adds what happens if you miss it: the transaction is canceled.
# Approve
curl -X POST "https://api.telegram.org/bot<TOKEN>/answerPreCheckoutQuery" \
-d "pre_checkout_query_id=<id>" -d "ok=true"
# Decline, with a message Telegram shows the user
curl -X POST "https://api.telegram.org/bot<TOKEN>/answerPreCheckoutQuery" \
-d "pre_checkout_query_id=<id>" -d "ok=false" \
-d "error_message=That plan is no longer available. Please choose another."Ten seconds sounds generous until you look at what usually eats it:
- The update never arrives. If you set
allowed_updatesonsetWebhookorgetUpdatesto a short list such as["message", "callback_query"], you will not receivepre_checkout_query, and every payment times out. An empty list gets every update type exceptchat_member,message_reactionandmessage_reaction_count, so the default is fine. Check the current value with our Telegram webhook checker, which readsgetWebhookInfo. - A cold start or a slow queue. A serverless function waking up, or a worker queue that processes updates in order behind a slow job, can miss the deadline. Answer pre-checkout queries on a fast path before anything else.
- Doing the work before answering. Check stock or order validity, answer, then do the rest. Do not deliver anything here.
- A dead webhook. If updates are queueing up, pre-checkout queries queue with them and arrive too late. Our guide to pending_update_count shows how to tell.
Answering ok=true does not mean you have been paid. The Stars guide warns that "simply answering a pre_checkout_query does not guarantee a successful order or payment" (source).
Deliver on successful_payment, and keep the charge ID
The payment is final when your bot receives a message with a successful_payment field. Telegram's rule: "You must always check that you received a successful_payment update before delivering the goods". The object carries what you need to fulfil and, later, to refund:
| Field | What to do with it |
|---|---|
invoice_payload | Your order ID from sendInvoice. Look up the order and mark it paid. |
currency, total_amount | Check them against the order. For XTR the amount is a whole number of Stars. |
telegram_payment_charge_id | Store it. You need it for refundStarPayment and for subscription changes. |
provider_payment_charge_id | The provider's ID for physical-goods payments, for reconciling with Stripe or another provider. |
is_recurring, is_first_recurring, subscription_expiration_date | Present for subscription payments. Use them to extend access. |
The reference also adds a warning that applies to provider payments: "if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance". Make fulfilment idempotent, keyed on telegram_payment_charge_id, so a retried update never delivers twice.
Stars subscriptions: createInvoiceLink with subscription_period
Recurring billing exists only in Stars. You create it with createInvoiceLink and a subscription_period, then send the link to the user.
curl -X POST "https://api.telegram.org/bot<TOKEN>/createInvoiceLink" \
-H "Content-Type: application/json" \
-d '{
"title": "Pro monthly",
"description": "Renews every 30 days",
"payload": "sub_user_123456789",
"currency": "XTR",
"prices": [{ "label": "Pro monthly", "amount": 250 }],
"subscription_period": 2592000
}'The rules, from the createInvoiceLink reference:
- The currency must be
XTRwhensubscription_periodis used. - The period "must always be 2592000 (30 days)". No weekly or annual plans yet.
- The price must not exceed 10,000 Stars.
- Any number of subscriptions can be active at once, including several from the same user.
Each renewal arrives as another successful_payment with is_recurring set, and the first one also has is_first_recurring. Extend access to subscription_expiration_date rather than adding 30 days yourself.
To stop a subscription from your side, call editUserStarSubscription with the user's ID, the subscription's telegram_payment_charge_id and is_canceled=true. The reference says the subscription must stay active until the end of the current period, so cancelling stops the next renewal, not today's access. Passing is_canceled=false re-enables a subscription the bot cancelled.
Refunds, /paysupport and getting paid
A Stars refund is one call:
curl -X POST "https://api.telegram.org/bot<TOKEN>/refundStarPayment" \
-d "user_id=123456789" \
-d "telegram_payment_charge_id=<charge id from successful_payment>"After a refund your bot receives a message with a refunded_payment field (a RefundedPayment object whose currency is "Currently, always XTR"). Use it to revoke access.
The obligations around refunds matter more than the method:
/paysupportis required. The developer terms say every bot "must be able to respond to the command /paysupport" and deal with payment requests. Telegram's own support will not handle your buyers' disputes.- Disputes are yours. Section 6.2.1 says Telegram "has no obligation to mediate or be a party to any such disputes". If a dispute ends in a refund, the Stars come out of your bot's balance.
- Telegram does not refund users. The Stars terms say "All sales of Telegram Stars are final" and point users to the bot's developer, who "has the ability to refund your Stars at no penalty".
- Offer
/termsand/supportas well. Both are on the Stars guide's go-live checklist.
Earned Stars can buy Telegram Ads for your bot, or be exchanged for a reward. The developer terms say Telegram "currently outsources the processing of rewards to Fragment", and that Stars "may not become available for advertising credits or rewards for up to 21 days after their receipt" (section 6.2.4, Bot Platform Developer Terms). Plan your cash flow around that hold. To check your balance and history from code, use getMyStarBalance and getStarTransactions (up to 100 transactions per call).
Physical goods: connecting Stripe or another provider
For physical goods and services, Telegram does not handle the money. The payments guide says "Telegram does not collect payment information and takes no commission", and that card details are held by the provider, so "neither Telegram nor the bot developers have access to it" (Telegram Bot Payments API). Telegram lists more than 20 providers. Which ones you can choose depends on where your business is registered, and BotFather shows the list.
- In @BotFather, send
/mybots, pick the bot, and open Bot Settings > Payments. - Choose a provider and finish its onboarding. BotFather then shows a provider token for that bot.
- Start with Stripe TEST MODE. Test cards such as
4242 4242 4242 4242work and real cards do not. A live token contains:LIVE:, which is an easy way to check which one a deploy is using. - Call
sendInvoicewith that token asprovider_token, an ISO currency, and as manypriceslines as you need (amounts in the smallest unit, so US$14.50 is1450).
Physical invoices get features Stars invoices do not:
- Shipping. Set
need_shipping_address. Addis_flexibleif the price depends on the address, and you will receive ashipping_queryto answer withanswerShippingQueryand a list of shipping options, orok=falseand an error message. - Tips.
max_tip_amountplus up to foursuggested_tip_amounts, in increasing order. - Customer details.
need_name,need_phone_numberandneed_email, with optional forwarding to the provider.
Amount limits apply per currency. Telegram says they "roughly correspond to the limit of US$ 1-10000", and amounts must fit in 12 digits. The exact numbers are in currencies.json, which also gives each currency's exp (decimal places). The pre-checkout deadline and successful_payment rules are the same as for Stars.
Testing without spending real Stars
Telegram runs a separate test environment, and the Stars guide says "You can freely test payments in Telegram Stars by connecting your bot to Telegram’s dedicated test environment". The test environment is completely separate from production, so you create a new user account and a new bot with @BotFather there, use the test API URL (https://api.telegram.org/bot<token>/test/METHOD_NAME, per Telegram's test environment docs), and run the whole flow end to end, including a refund.
A test checklist that catches most launch problems:
- Invoice sends. Then check the price in the client matches your
prices. - Pre-checkout is answered in under a second, with the bot under some load.
- Declining with
ok=falseshows yourerror_message. - The
successful_paymenthandler delivers exactly once, even if you replay the update. refundStarPaymentworks with the stored charge ID, and therefunded_paymentmessage revokes access./paysupport,/termsand/supportall answer.
If the invoice call fails before you get this far, check the basics first: a revoked or mistyped token returns 401 Unauthorized (our token checker confirms which bot a token belongs to), and a user who blocked the bot returns 403 Forbidden: bot was blocked by the user.
When a payment fails: symptom, cause, fix
| Symptom | Likely cause | Fix |
|---|---|---|
| User taps Pay, then the payment is canceled after a spinner | No answerPreCheckoutQuery within 10 seconds | Make sure pre_checkout_query is in allowed_updates, and answer it before any slow work |
| XTR invoice rejected | More than one prices item, or a non-empty provider_token | One price line, empty token, currency: "XTR" |
| Tips or shipping fields missing on a Stars invoice | Expected: they are not supported or ignored for XTR | Collect details in the chat instead |
| Physical invoice works in test, fails live | Deploy still uses the TEST token, or the live provider onboarding is not finished | Check the token contains :LIVE:; finish onboarding in BotFather |
| Goods delivered but no money | Delivery triggered on pre-checkout instead of successful_payment | Deliver only on successful_payment |
| Delivered twice | Update retried after a slow webhook response | Make fulfilment idempotent on telegram_payment_charge_id |
| Cannot refund an old Stars payment | Charge ID never stored | Persist telegram_payment_charge_id with every order |
| Two bot processes and payments arrive at random | Two consumers on one token: 409 Conflict | Run one consumer: polling or webhook, never both |
For the full list of Bot API error strings and what each one means, see the Telegram error reference. For the per-chat and global sending limits that affect a bot sending many invoices at once, see Telegram limits. Most payment failures are not payment errors at all. They are ordinary delivery problems, the same ones covered in Telegram bot not responding.
Taking payments in a Conferbot Telegram bot
Conferbot has payments built into the flow: a Payment step you drop into any conversation, on Telegram and on every other channel the bot runs on. It runs on Stripe Checkout through your own Stripe account, connected once per workspace, and the bot keeps going on its own once the customer pays.
- The amount is fixed on Conferbot's server, either a set price or a value the conversation collected, so it can't be edited in the chat.
- On Telegram the step sends the secure checkout link inside the chat, then tracks the payment itself. You don't build anything to find out whether the customer paid.
- The flow branches on the result: paid, failed or cancelled, and timed out. The payment's details are saved as variables, so the next message can confirm the order, retry, or hand over to a person in the shared inbox.
- The same step works everywhere the bot is deployed. On your website the widget shows a pay card inside the chat; on WhatsApp, Messenger and the other channels it sends the link, exactly as on Telegram.
The rest of the conversation is built in the same no-code AI chatbot builder: collecting the order, answering questions with AI, and handing over to a person when needed.
One rule to plan around: Telegram requires digital goods and services sold inside Telegram to be paid in Stars. Conferbot's Payment step uses Stripe, not Telegram's own invoices or Stars, so use it for physical goods and real-world services. A bot that sells digital goods inside Telegram needs Telegram's Stars invoices, built against the Bot API as described above.
Was this article helpful?
Build and deploy in 10 minutes. No coding needed.
Telegram Bot Payments in 2027 FAQ
Everything you need to know about chatbots for telegram bot payments in 2027.
About the Author
The Conferbot team writes about building, deploying, and improving AI chatbots.
View all articlesRelated Articles
From the reference shelf
Fact-checked reference pages and free tools for the platform this article covers.