tg-stars-payments
Installation
SKILL.md
tg-stars-payments
Checked against the official docs on 2026-10-30: Bot API 10.3 (August 24, 2026), the Stars payments guide and the developer terms § 6.2. Nothing here was run against a live bot, see Not verified live.
Digital goods and services sold inside Telegram apps go through Stars only: currency XTR, empty provider_token. Physical goods use a provider, see Payments. Payout rates, the hold, expiry and the 15% topics fee live in references/stars-economics.md; read it before quoting money or enabling topics in private chats.
Purchase flow
- Subscribe. The active
allowed_updatesincludesmessageandpre_checkout_query, plussubscriptionandpurchased_paid_mediawhen you sell those. An omitted list keeps the previous setting, seetg-bot-ops. A bot withoutpre_checkout_querylets every checkout time out. - Create the invoice (table below). Put an order id in
payload(1-128 bytes). The title is 1-32 characters, the description 1-255,priceshas exactly one item, amounts are whole Stars. - Answer pre-checkout within 10 seconds with
answerPreCheckoutQuery, or the transaction is canceled. Answer it in the handler itself, outside any update queue: a queue that lags 10 seconds cancels the purchase. Check stock and order state, not delivery. Onok: falsepasserror_message; Telegram shows it to the user. - Credit on
successful_paymentonly. It arrives as a service message. Answering pre-checkout proves nothing; a Mini Apppaidstatus is a hint for the UI. - Store first, deliver second. See Recording and delivery.
- Support. The bot answers
/paysupport, and refunds through Refunds.
Done when: a repeated successful_payment starts no new delivery, two parallel handlers claim a payment once, and a crash between storing and delivering returns the order to the queue.