Fragment Donor SDKSource

Version 0.1.3 · Registry installation commands use exact versions.

Telegram Stars API vs Bot Payments API

Choose between gifting Stars to a username and accepting Stars for digital goods inside a Telegram bot or Mini App.

Choose by the direction of value. To accept Stars from a customer for digital goods inside your bot or Mini App, use Telegram’s official Bot Payments API and XTR invoices. To send or gift Stars to a recipient username from your backend, this independent Fragment Donor API covers that separate workflow.

Bot Payments uses a bot token, invoice or invoice link, pre-checkout handling, and successful_payment updates. Fragment Donor purchase calls instead use a wallet mnemonic and Fragment session cookie on a trusted server. The credentials and risk model are not interchangeable.

For a username gift, validate the recipient, decide one amount, submit one purchase, and reconcile ambiguous results. For selling digital goods, follow Telegram’s official invoice, pre-checkout, fulfillment, and refund documentation.

Fragment Donor is an independent project and is not an official Telegram, Fragment, or TON SDK. Do not describe its packages as official clients.

Example

Receive Stars for digital goods -> Telegram Bot Payments API (XTR)
Send Stars to a username       -> Fragment Donor buy-stars
Gift Premium to a username     -> Fragment Donor buy-premium

Continue reading

Telegram Stars API: send Stars to a username · How to send Telegram Stars to a username · Fragment Donor API and SDK FAQ

OpenAPI 3.0 · Postman collection