Shiba Bank

How to accept Stars payments in your own bot

How to accept Stars payments in a Telegram bot: an invoice in XTR without a payment provider, answering pre-checkout within 10 seconds, Stars refunds, the /paysupport command and withdrawing Stars through Fragment.

Updated 2026-10-02 · 3 min read

Digital goods and services in Telegram bots are sold for Stars. You don't need a payment provider for that: the bot issues a Stars invoice itself through the Bot API, and the Stars land on the bot's balance.

Why Stars

Under Telegram's rules, digital goods and services in bots and mini apps are paid for only with Stars — app store rules require it too. Physical goods can be sold for money through payment providers.

How to issue a Stars invoice

  1. Call sendInvoice (an invoice in a chat) or createInvoiceLink (a payment link).
  2. Set the currency to XTR — that's how the Bot API names Stars.
  3. Leave provider_token as an empty string: Stars need no provider.
  4. In prices, pass one item — the amount in Stars.

The user sees the invoice, confirms the payment, and the Stars are taken from their balance.

See also: How to create a Telegram bot.

Required steps after payment

  • pre_checkout_query. Before charging, Telegram sends the bot a query. You must answer answerPreCheckoutQuery within 10 seconds, or the payment is cancelled and the user sees the "bot precheckout timeout" error. Answer right away and do the heavy work after answering.
  • successful_payment. After payment, a message with telegram_payment_charge_id arrives. Store it: you need it for a refund.
  • Delivery. Deliver the goods only after successful_payment.

Refunds, history and support

  • Refund — the refundStarPayment method with telegram_payment_charge_id: the Stars go back to the buyer.
  • History — the getStarTransactions method shows the bot's incoming payments and refunds.
  • /paysupport — the bot must answer this command: it's how buyers ask about payments.

Subscriptions and paid content

  • Subscription. In createInvoiceLink you can set a subscription period — Stars are then charged every 30 days until the user cancels.
  • Paid photos and videos. The sendPaidMedia method sends content that unlocks for Stars; how it looks to people is in photos and videos for Stars.

How to withdraw a bot's Stars

Stars collect on the bot's balance, shown in the bot's profile: "Edit" → "Balance". They can be withdrawn through Fragment — from 1,000 Stars, and each one becomes available 21 days after it arrives. A bot's Stars can also pay for Telegram Ads at a discount — Telegram Ads for Stars. Withdrawal step by step is in how to withdraw Stars from a bot.

Tip

Need to send Stars or Premium to your users rather than accept Stars? The Shiba Bank bot's API does that — the Telegram Stars API.

FAQ

How do I add Stars payments to a Telegram bot?

Issue an invoice with sendInvoice or createInvoiceLink in XTR with an empty provider_token, answer pre-checkout within 10 seconds and deliver after successful_payment.

Do I need a payment provider for Stars?

No. For Stars, provider_token is an empty string.

How do I refund Stars to a buyer?

With the refundStarPayment method and the telegram_payment_charge_id from the payment message.

When can I withdraw a bot's Stars?

Through Fragment — from 1,000 Stars, each available 21 days after it arrives.

Everything inside Telegram

Open the bot
QR code of the link to Telegram

Open in Telegram

Point your phone's camera at the code

Open in Telegram Desktop

The Shiba Bank window opens in Telegram.A chat with the bot @barboskich_stars_bot opens.Telegram will ask you to pick a group and give the bot admin rights.