Selling digital goods and services for Stars
What it is
Anything digital a bot or Mini App sells, from an e-book to a game item, must be priced in Stars (currency XTR). Apple and Google rules demand it, even if you also sell on your own site; otherwise Telegram can't show your bot to mobile users. Crypto is out too; physical goods can use regular payment providers. Of $1.99 paid for 100 Stars, the developer gets $1.30.
How to do it
- Create a bot in @BotFather.
- Send an invoice with sendInvoice (currency XTR, empty provider_token) or a link from createInvoiceLink.
- When the buyer taps Pay, answer pre_checkout_query with answerPreCheckoutQuery… When the buyer taps Pay, answer pre_checkout_query with answerPreCheckoutQuery within 10 seconds, or the payment is cancelled.
- Deliver only after the successful_payment update, and save its telegram_payment_charge_id for refunds.
- Add /terms and /paysupport. Buyers must accept your terms before paying.
- Test in Telegram's test environment, then go live.
- Track earnings: bot profile › Edit › Balance on iOS and Android; Bot Info › ⋮ › Manage Bot › Balance on Desktop.
Watch out
- Inline and forwardable invoices can be paid many times: accept only orders you can fulfil.
- Subscriptions bill every 30 days and cost at most 10,000 Stars.
- Taking other payments for digital goods brings a notice, then the bot may be hidden from store versions or removed.
- Turning on topics in private chats in @BotFather adds a 15% fee to the bot's Stars purchases.
- Turn on two-step verification for the bot owner's account.
With Gem
Gem sells for you: /myprojects → Sell → + New offer, in words («Supporter for 1 Star: a badge and a thank-you»). Gem reviews the offer before it sells, the buyer pays in your project's Mini App, gets the badge and thanks once, and you hear about each sale in @gembot.
Sources
- https://core.telegram.org/bots/payments-stars
- https://core.telegram.org/bots/api#payments
- https://telegram.org/tos/bot-developers