Version 0.1.3 · Registry installation commands use exact versions.
Telegram Premium Gift API for a username
Validate a recipient and gift 3, 6, or 12 months of Telegram Premium through a server-side API with safe payment handling.
Purchase requests transmit your wallet mnemonic and Fragment session/cookie to the API operator.
Use the Premium gift endpoint when your backend needs to send a subscription to a Telegram username. Check get-user-info first and inspect is_premium before offering the purchase.
POST /buy-premium/ accepts username, duration, and payment_method as form data. duration is exactly 3, 6, or 12; payment_method is usdt_ton or ton. The request uses the same protected wallet headers as a Stars purchase.
Create only one purchase request for the user’s explicit choice. Never silently change the duration, send both Premium and Stars, or retry after a timeout. Reconcile the recipient and wallet state before a new intentional purchase.
The seven SDK packages expose the same operation with native language naming and typed error categories. Test with synthetic fixtures and an injected transport instead of a real purchase.
Example
curl -X POST https://fragment.donor.uz/buy-premium/ \
-H "Cookie: $FRAGMENT_COOKIE" -H "Mnemonic: $WALLET_MNEMONIC" \
--data-urlencode "username=durov" --data "duration=3" \
--data "payment_method=usdt_ton"Continue reading
Gift Telegram Premium through the API · Integrate Telegram Premium gifts into your backend · Payment timeout: prevent duplicate Telegram Stars purchases