Business

Can a Bot Widget Take Stars Payments? Storefront, Invoice and TON Requests

A widget can serve as a storefront, but a separate invoice is the better way to collect Stars. This article covers widget limits, steps for updating prices and how a TON wallet request affects buyer trust.

Short answer

Yes. An HTML widget from Bot API 10.4 can let buyers pick a package and see its price, so it can work as a storefront. But a widget only handles the selection. According to the official docs, it can ask for a payment or a signature through Telegram’s built-in wallet. The docs don’t describe opening a Stars invoice inside a widget. A separate invoice sent by the bot is the more reliable way to collect Stars.

Can a bot’s HTML widget work as a shop storefront?

Bot API 10.4 was released on November 9, 2026 (Bot API changelog). It added the sendWidget method, so bots can now send messages with HTML widgets. The Widgets page defines a widget as a small interactive block drawn right inside a message.

For a shop owner, this means you can show a selection screen in the chat itself, with no Mini App to open. For example, a “Stars packages” card could have 50, 100 and 500 buttons, with the price of the selected package shown below. When the buyer taps a button, the price updates. A “Pay” button sends a query to the bot, and the bot replies by sending a separate payment message to the chat.

We found nothing in the official docs about opening a Stars invoice inside a widget. This article can’t confirm that it works, so we don’t recommend relying on it.

What can a widget do for a storefront, and what can’t it do?

A widget is not a Mini App. It’s part of the message, stays visible as the chat scrolls and can’t reach the network. Its JavaScript doesn’t run in a WebView or a browser. It runs in QuickJS, a small JavaScript engine. Because of that, the libraries you’re used to from Mini Apps may not work unless you change them.

What the shop needsAvailable in a widget?Notes
Product card with name, price and buttonsYesDrawn in HTML
Images, fonts or styles loaded from your serverNoExternal resources are never loaded
Widget fetching prices from your website itselfNofetch, XMLHttpRequest and WebSocket throw NetworkDisabledError, so the bot has to send the price
Navigating to another pageNoWidgets can’t navigate
Storefront inside a groupNot yetOnly private chats in production
Copying to another chat with copyMessageNocopyMessage and copyMessages refuse widgets
One price list reused in many messagesYesThrough a shared widget
Large catalogLimited32 768 bytes of UTF-8 HTML, and 4 096 bytes after zlib compression

The size limit is strict, and a catalog with hundreds of items won’t fit. Keep only your best-selling items in the storefront and put the rest in the bot’s menu. External images don’t load, so build the design from emoji, colour and short text.

A shared widget works like a poll: it’s one object, and any number of messages can point to it. That’s what a price list needs.

Get Telegram Stars, Premium or gifts in som — only a @username is needed, delivered in seconds.

@StarsPaymee_bot

How do you update prices and stock in the storefront?

  1. Allow queriesturn on allow_queries when you send the widget. If it’s off, every request from the widget is refused everywhere.
  2. The buyer tapsa widget sends a query only on a tap, never in the background. The bot receives it inside an Update, as described in the Bot API.
  3. The bot answerswith answerWidgetQuery, it returns the price, the stock left or an “out of stock” flag.
  4. The card updatesuse editMessageWidgetData to replace the widget’s data. You don’t need to send a new message.
  5. One price list, many chatssendSharedWidget sends a shared widget the bot created again, and editSharedWidgetData changes its public data in one place.

For example, say your storefront is a shared widget sitting in 300 buyers’ chats. When a price changes, you don’t edit 300 messages one by one. They all point to one object, so you change the public data once. Never put a buyer’s personal cart or order in a public field, because everyone will see it.

Another practical rule: the price on a widget shows what it was when the buyer tapped. Before sending the payment message, have the bot check the price in its own database again. Don’t trust the number on an old card.

Should you collect Stars through the widget or an invoice?

Important
The Widgets docs say a widget can ask the user to pay or sign through Telegram’s built-in wallet. They say nothing about showing a Stars invoice inside a widget.

A workable setup for a bot that sells digital services:

  • Widget: the buyer picks a package and quantity.
  • Bot: sends a separate Stars invoice message to the chat.
  • After payment is confirmed: the bot delivers the service and uses editMessageWidgetData to show a “paid” status in the widget.
  • Accounting: rely on the payment message the bot receives, not on the “paid” label in the storefront.

For the technical steps of connecting an invoice, see how to add Stars payments to a bot. For linking a catalog and an invoice in one flow, see Stars payments in rich messages.

Bot rules are a separate question. We covered checks on bots that sell digital services without Stars in our article on the “Stars only” rule. This article can’t confirm whether selling digital goods for TON through a widget follows the rules. Check Telegram’s rules yourself before you launch a setup like that.

When a widget asks for a TON wallet, what does the bot get?

  • Wallet card: in a wallet call, the bot gets the TonWalletCard from the user’s profile, along with its address and balance. The Bot API page says that in private chats the bot also gets the TON wallet card shown on the user’s profile page.
  • New wallet: if the user has no wallet, one is created right then. For someone who only came to buy Stars, that can be a surprise.
  • Confirmation window: the payment or signature window shows the bot, the amounts and the recipients, and the user confirms them.
  • Declining: if the buyer declines in that window, the bot gets a REJECTED error.
  • Signature domain: the signature is made for a domain built from the word “bot” and your bot’s ID. The docs recommend checking the signature against the wallet’s public_key and linking that key to the wallet’s address on the blockchain.
  • New classes: the changelog adds WidgetQueryType and its subtypes, the TonWalletCard-related classes, TonWalletTransfer and a ton_wallet_transfer field on Message.

We couldn’t confirm two things. First, whether users are asked for separate consent before their wallet card goes to the bot. Second, whether there’s an explicit rule that private keys never reach the bot. Don’t promise buyers either one.

How can a wallet request hurt buyer trust?

  • Requests with no reason: people buying Stars or Premium don’t need a wallet. They can buy in som with just an @username. More on this: linking a wallet to your account.
  • Signatures with no clear purpose: ask for a signature only when you have a specific reason, such as proving ownership in an NFT-related service. Don’t ask for one on a plain Stars package.
  • Mismatched amounts: the amount and recipient in the wallet window must match what the storefront shows. A buyer who spots a difference will suspect a scam.
  • No plan for a decline: if you get REJECTED, offer another way to pay right away, such as a Stars invoice.
  • Using the balance: say clearly in your privacy policy that the bot sees the balance, and never change prices based on it.
  • Copycats: scammers may build a widget that looks like your storefront and ask for a signature. Keep announcing your official bot username in your channel.

What should you check before launching the storefront?

  1. Sizecompare the HTML size and the compressed size against the 32 768 and 4 096 byte limits.
  2. Offline lookmake sure the storefront still makes sense without external images or fonts.
  3. Chat typein production, the storefront works only in private chats. In groups, use a regular button with an ephemeral reply, which only the person who tapped the button sees.
  4. Fallbackwidgets are rolling out in stages. Keep a regular button menu for buyers who don’t have them yet.
  5. Paymentmake a real test purchase through the invoice from your own account.
  6. Queriescheck that allow_queries is on and that the bot responds to answerWidgetQuery.
  7. Price checktest that the invoice amount matches the current price in the bot’s database.

What do posts about the update often get wrong?

News about Bot API 10.4 has been circulating in Telegram channels. When you plan, go by the official changelog and the Widgets page.

  • Ephemeral messages: these didn’t arrive in 10.4. The changelog says they came in Bot API 10.2. Version 10.4 lets bots send ephemeral replies to callback queries in any chat except channel direct messages chats.
  • Quotes: ReplyParameters gained a quote_rich_texts field, so bots can now quote rich messages.
  • “Games”: no official source confirms games as an example widget.
  • “Beta” status: the changelog doesn’t use that word, so don’t base your plans on it.
  • Groups and inline mode: in production, widgets can only be sent to private chats for now.

How can you get Stars or Premium in som for a test purchase?

To test an invoice, you need Stars on your own account. You can buy them in som through @StarsPaymee_bot with just your @username. Orders are usually delivered automatically within a few seconds. You don’t need a password, SMS code, international card, crypto wallet or VPN.

The price per Star depends on how you pay: 220 som by UzCard/HUMO card transfer or from your bot balance, and 240 som through Click, Payme, Uzum or Paynet. The minimum order is 50 Stars. See the Stars page for details.

If you need Premium on your own account, it costs 159,900 som for 3 months, 216,000 som for 6 months and 388,000 som for 12 months. The price is the same for every payment method. If your account already has active Premium, the bot won’t open a new order, because time isn’t added on top of an active subscription. More on the Premium page.

Extra services for channel and bot owners are on the business page. StarsPaymee is an independent service and doesn’t claim any official link to Telegram.

Frequently asked questions

If I put a “Pay with Stars” button inside the widget, will the payment open right there?
The docs say a widget asks for payment or a signature through Telegram’s built-in wallet, and they don’t mention Stars invoices. It’s more reliable to have the button send a query to the bot and have the bot send the invoice as its own message.
Can my storefront load product images from my server?
No. Widgets don’t load external images, fonts or stylesheets, and network requests throw an error. Build the design from emoji, colour and short labels.
Why can’t I post my storefront widget in my shop’s group?
In production, widgets can only be sent to private chats for now. In a group, use a regular button and answer it with an ephemeral reply that only the person who tapped sees.
If I change a price, do I have to edit every widget I’ve already sent?
Not if your storefront is a shared widget. You change its public data once with editSharedWidgetData. With a regular widget, you call editMessageWidgetData for each message.
Does a widget send queries to the bot in the background if the buyer doesn’t tap it?
No. Widget queries go out only on a tap. The bot can still update the widget’s data whenever it wants with editMessageWidgetData.
Can I look at a buyer’s TON balance through the widget and tailor my offer to it?
In a wallet call, the bot gets the address and balance from the user’s profile card. Changing prices based on that balance will cost you buyers’ trust, though. State clearly in your privacy policy that the bot can see the balance.
What does the bot get if the buyer taps “Decline” in the wallet window?
The bot receives a REJECTED error. Plan your response in advance, for example by offering to take payment through a Stars invoice.
Can a competitor copy my storefront into their own bot?
Not with Telegram’s tools, because copyMessage and copyMessages refuse widgets. Someone could still rebuild the design by hand, so keep announcing your official bot username in your channel.
Some of my buyers don’t see widgets yet. How do they order?
Widgets are rolling out in stages, so not everyone has them yet. Keep a regular button menu next to the storefront as a fallback.
How can a bot owner get Stars for testing without an international card?
Buy them in som through @StarsPaymee_bot with UzCard/HUMO, Click, Payme, Uzum or Paynet. You only need your @username. The minimum order is 50 Stars, and you don’t need a crypto wallet or VPN.

Need Stars, Premium or a gift?

Pay in som in @StarsPaymee_bot via Click, Payme, Uzum, Paynet or card. Only a @username is needed — the order arrives in seconds.

Open the bot