Partner program → Blog → Telegram Stars selling bot
Telegram Stars selling bot: how to build your own and where to source the stars
Short answer: the bot is an evening's work — the supply side is the hard part. The official Bot API can accept Stars from users, but it can't buy them: it has no "buy stars for money" method. So a Telegram Stars shop comes in two halves — your storefront and someone else's sourcing. You write the storefront yourself and pull the stars over an API from a supplier who pays with their own wallet and delivers them to the recipient.
Below: what a stars-selling bot is made of, where the stars come from, where your revenue sits in that chain, and what to check with a supplier before the first order.
Looking for the opposite — where to sell the stars off your own account for cash? That's what buy-back services do, and it's a different topic. This is about the shop side: how to sell stars to buyers.
What this kind of bot sells, and who buys from it
The range is simple: Stars sold in packs, and 3, 6 or 12 months of Telegram Premium. Stars arrive as a pack, Premium as a subscription, and both go to the recipient by username — no files, no activation codes.
A buyer goes to a middleman for three reasons, and all three are about money. On Fragment, stars are paid for in TON — that means a wallet and converting cash into crypto. Inside Telegram, paying by card doesn't work for everyone. And they need 500 stars for a gift right now, not a crash course in wallets. Your shop takes the money they already use — card, instant bank transfer, crypto — and hands over the stars in minutes. That gap in price is what they pay for the service.
A separate category is channel owners and creators who need Telegram Stars regularly and in batches. They're easiest to handle on a separate price list: purchases like that repeat by themselves, with no advertising.
What a stars-selling bot is made of: five building blocks
The question "how do I build a Telegram Stars selling bot" breaks into five pieces, and there isn't much code in any of them:
- Storefront. Menu, packs, buttons. In aiogram or telebot, a hundred or two lines.
- Checkout. Taking money from the buyer: an off-the-shelf integration with a card processor, an instant-transfer gateway or a crypto payment bot, plus a check that the payment actually went through.
- Order to the supplier. One HTTP request: product type, number of stars, the recipient's username, an idempotency key.
- Statuses. Receiving the webhook, showing the buyer the result, an order log — SQLite will do.
- Edge cases. A typo in the username, a declined payment, a failed delivery. Not code but your own rules — and you can't do without them.
Buying the stars isn't on the list: it isn't your concern. That is the only reason a Telegram Stars selling bot comes together in an evening rather than a month.
Where the stars come from: three routes
| Your own wallet + Fragment | Third-party wrapper | Supplier API | |
|---|---|---|---|
| What you need up front | a funded TON wallet, your own automation | a service key, your phone number and wallet seed phrase | an API key, a balance |
| Who pays for the purchase | you, in TON | you, from your own wallet | you, from a USDT balance |
| Who holds the wallet | you | the service gets access to yours | the supplier, with theirs |
| What breaks | the exchange rate, delivery failures, changes on Fragment's side | the service knows your seed phrase | you need a decent API — see below |
| When you launch | weeks of development | right away, but risky | the same day |
About that middle column, plainly: it turns up in every other ready-made script. Public wrappers around Fragment authenticate like this — you send the service your phone number and your TON wallet's seed phrase, it gets a token and pays from your wallet. The seed phrase is the wallet: whoever knows it controls the money. A source-code breakdown of three such builds is a separate piece, with quotes from the repositories.
The third route does without a wallet entirely: you keep a prepaid balance, the order price is debited from it, and the Telegram Stars supplier handles the purchase, the delivery and the retries.
Our API as the supply side of your bot
We don't give you a finished bot: you write it yourself, however you like and in whatever language you like. We give you what your shop has nowhere else to get: wholesale Telegram Stars and Premium, over a REST API.
The whole conversation with the Telegram Stars API is four requests:
GET /api/partner/v1/products → what's on sale and at what price
POST /api/partner/v1/validate/recipient → does @username exist, and whose name is it
POST /api/partner/v1/orders → the order + idempotency_key
GET /api/partner/v1/orders/{id} → status, if the webhook never arrived
The order itself looks like this:
POST /api/partner/v1/orders
{
"type": "stars",
"params": { "quantity": 1000, "recipient": "@username" },
"idempotency_key": "shop-order-4821"
}
What matters to a shop that runs unattended at night:
- Idempotency. The same
idempotency_keymeans the same order and exactly one debit. If a mobile network cuts the response short and your code repeats the request, there is no second order. - Recipient check before payment.
POST /validate/recipientreturns the name from the profile, so the buyer sees who the purchase is going to. For Premium it reports that the subscription is already active — so an order that is guaranteed to fail never gets created. - Signed webhooks.
order.completed,order.failed,order.refunded, with the body signed asX-Signature: hex(hmac_sha256(body, webhook_secret)). A forged "completed" status won't work. - Automatic refunds. If delivery fails, the price returns to your balance on its own.
- An honest rejection. If the balance is short, you get
402 insufficient_balancestraight away, with no orders left hanging. - Limits published openly. 120 requests per minute per key, up to 50,000 stars in a single order, Telegram Premium for 3, 6 and 12 months.
- Five order statuses.
processing,completed,partial,canceled,failed. Handle all of them:partialmeans part of the order landed — that's a separate scenario for support.
The pk_live_... key is issued in the dashboard and tied to your IPs. We don't ask for wallets, phone numbers or seed phrases. The documentation and the OpenAPI spec are open before you connect: size up the integration in advance, without paying to get in.
Where your revenue sits in all this
The money flow is simple. The buyer pays your retail price. Our order price is debited from your balance — it's returned by GET /products and doesn't move with exchange rates. The difference stays with you.
Out of that difference, subtract three costs beginners forget:
- your payment provider's fee — usually 2–3.5% of turnover, not of margin;
- refunds and disputes — changed their mind, got the username wrong, paid twice;
- support — minutes per order, and at a hundred orders a day that's already a full-time job for someone.
Take your retail benchmark from open storefronts: our own tgsuperstars.com publishes the going retail price per star, and the gap between that price and your cost is your margin. You can price above the market if you give buyers a reason to pay it: instant delivery at night, one-tap payment, support in chat.
The main rule: don't calculate the order amount with a formula of your own. The price is fixed by the response to the order creation call — tie your debit to that, or a move in rates will have you selling at a loss.
Three places where shops like this break in the first month
The username isn't checked. The buyer types @ivan_petrov instead of @ivan_petroff, the bot sends the order, and the stars go to a stranger. There's no getting them back. The cure is a validate/recipient call before payment and a confirmation step: "sending to Ivan P.?".
There's no order log. The customer says "it never arrived" and the database holds only the last payment. Store them together: the payment id from your payment provider, the idempotency_key, the supplier's order number and the final status. A dispute then closes in a minute.
One key for test and production. A test run on a live key means real debits from your balance. Keep separate keys and restrict the live one by IP.
How long the launch takes
A storefront with one pack and the full cycle is an evening, if you've written bots before. A day, if this is your first. After that come more packs, Premium, referral links, an admin panel with stats — but you can sell from the first run-through onwards.
Do the first run on yourself: the minimum top-up on your balance, 50 stars to your own account, the webhook — then look at what the buyer saw. It costs the price of one pack and finds every slip in your logic at once.
What to check with a Telegram Stars supplier before the first order
The short version: does an order take an idempotency key; is there a recipient check; are webhooks signed; is the money returned when delivery fails; are the limits published; is the documentation open before you pay. The full checklist, with an explanation of why each item has cost somebody money, is in the article on the Telegram Stars API and choosing a supplier.
FAQ
Do I need a separate bot, or can I sell on a website? A website works, and so does a mini app — the API is the same. A bot is the shorter path: the interface is already there, and the buyer doesn't have to register.
Can I accept payment in stars themselves? Yes, through sendInvoice with the XTR currency — a payment inside Telegram for a digital product. Selling stars for stars makes no sense, but subscriptions and access to content are sold that way all the time.
What if the buyer paid and delivery failed? Our price returns to your balance automatically, and the status arrives as an order.refunded webhook. Refunding the buyer is on you, through your own payment provider: you were the one who took their payment.
How much money do I need to start? As much as you're willing to keep in circulation: the balance is prepaid, and the minimum top-up is 10 USDT. There's no entry fee and no subscription fee.
Do you have a ready-made bot? No, and deliberately so: you'll tune your own shop to your audience better than any template. From us come the stars, the price and the API; everything else is yours.
Need a supplier for your bot or website?
Wholesale Telegram Stars and Premium over a REST API: up to 50,000 stars per order, delivery to a username in minutes, idempotency keys and signed webhooks. First top-up from 10 USDT.