How to accept Telegram Stars in a bot: the XTR payment flow
Developers selling digital goods in Telegram bots and Mini Apps must use Telegram Stars, with the currency code XTR. The article describes a payment flow that starts by writing a pending order to the database and using its ID as the invoice payload. Invoices are created with sendInvoice in chats or createInvoiceLink in Mini Apps, using an empty provider token and a single whole-number Stars price. On receiving a pre_checkout_query, the server must validate the order within Telegram's 10-second window before any Stars move. The author stresses that a client-reported "paid" status should never grant an item without server-side confirmation, and that duplicate or unexpected charges must be detected and refunded.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in