How to Sell License Keys and Digital Codes with a Telegram Bot
If you sell software licenses, access codes or vouchers on Telegram, you probably know the routine: a buyer messages you, you check the payment, copy a key from a spreadsheet, paste it back, and mark it as sold. It works until you are asleep, busy, or accidentally send the same key twice. This guide shows how to let a bot do all of it: take the payment in Telegram Stars, hand every buyer one unused key instantly, and stop selling when the stock runs out.
What you can sell this way
Anything where each buyer should get a unique code that only one person may use. The most common cases:
- Software licenses and activation keys for apps, plugins, themes or desktop tools you develop or are authorised to resell.
- Time-limited access codes: a 1-day, 7-day or 30-day pass to a service, a tool or a private community.
- Course and membership codes that unlock a lesson platform or a members area on your website.
- Gift cards, vouchers and discount codes you generate in your own shop system.
- Game keys and in-game item codes you have the right to distribute.
- Invite codes for betas, events or limited releases.
Two conditions apply. You must have the right to sell what you sell, and it must be digital: Telegram Stars are only for digital goods and services, which is exactly what a key is. Our Telegram Stars payments guide covers the rules, prices and withdrawal in detail.
How automatic key delivery feels for the buyer
- The buyer sends your command, for example /buy, or taps a button that runs it. The bot replies with your preview text: what the key is for, how long it lasts, what they need to do after buying.
- Under the preview sits a button such as Buy for 250 ⭐. One tap opens Telegram's native payment sheet. If the buyer is short on Stars, Telegram offers to top up on the spot.
- After they confirm, the bot sends your delivery message (installation steps, a download link, an image) followed by the key itself in a code block that copies with a single tap.
- When they need another key next week, they simply buy again and receive a new one. Key purchases are not a one-time unlock, every payment is a new sale.
No waiting for you to wake up, no screenshots of payments, no typos in a copied key.
The rules that stop double-selling
The hard part of selling keys is not the payment, it is making sure every key goes to exactly one person. A good key bot should guarantee the following, and TeleMinute does:
- One key per payment, never the same key twice. A key is marked as used in the same database operation that hands it out. Even if ten people pay in the same second, they get ten different keys.
- Given keys never come back. If you re-upload your full list after adding a few new lines, the keys that were already sold are skipped automatically. The same key also cannot sit in two commands of one bot, so a 7-day key cannot leak into the 30-day pool by mistake.
- Random order. Keys are shuffled when you upload them, so buyers do not receive them in the order of your file.
- No payment without stock. When the pool is empty, the buy button disappears and buyers see an out of stock note. Telegram's pre-checkout step is rejected too, so an old invoice cannot be paid.
- Automatic refund for the last-key race. If two people pay for the very last key at the same moment, the second payment is refunded automatically and the buyer is told why.
- Stock alerts. You get a Telegram message when 3 keys are left and another when the stock runs out, so you can top up before sales stop.
Set it up in TeleMinute, step by step
TeleMinute is a no-code Telegram bot builder that runs on the web and in native iOS and Android apps. Key selling is part of its Telegram Stars features and is available on the Premium plan ($3.99 per week, $9.99 per month or $49.99 lifetime, with regional discounts applied automatically). TeleMinute takes no cut of your sales.
- Connect your bot. Create a bot with BotFather and paste its token into TeleMinute (our BotFather guide takes two minutes). Payments land in the bot's own Stars balance, so use a bot you own.
- Create the product command. In the Commands tab, add a command such as /buy and write the delivery message in its reply: how to activate the key, where to download the software, who to contact for help. You can add images and buttons, for example a download link.
- Turn on Paid content. On the same command, switch on Paid content, enter the Price (Stars) and write a Preview text, the teaser buyers see before paying. Mention the duration or edition clearly, it is what people decide on.
- Choose Keys as the delivery. Under Delivery, pick Keys. Each buyer now gets one unique key from your list together with the command content.
- Write your key message (optional). The Key message field is the text shown right above the key. Write {key} where the key should appear, for example Thanks {name}! Your 30-day key: {key}. Variables such as {name} fill in automatically. Leave it empty and a short default message is used.
- Upload your keys. In the key pool below, upload a .txt file with one key per line or paste the keys into the box. Up to 5,000 keys fit into one upload and you can upload as often as you like. Duplicates and keys that already exist in the bot are skipped and reported. You can do this while creating a new bot too: the keys wait in the form and are added the moment the bot is saved.
- Save and test. Send the command to your bot, buy one key with your own Stars and check the whole flow. Then refund yourself from the Sales page.
Selling several durations or editions
Most key sellers offer tiers such as 1 day, 7 days and 30 days. Give each tier its own paid command with its own price and its own key pool, for example /day, /week and /month. Then create a free menu command, say /buy, with one button per tier that runs the matching command. Buyers see one tidy menu, and every button leads to the right price and the right keys.
Managing stock after launch
- Stock at a glance. The key pool shows how many keys are In stock and how many have been Given, plus a list of recently given keys with the buyer and the time.
- Download CSV. Export the whole pool with the status, buyer and date of every key, handy for your own records or for matching activations.
- Delete unused keys. Remove every key that has not been sold yet, for example when a batch expires. Given keys stay in the history.
- Keys belong to the command name. If you rename a command, add the keys again under the new name.
When a buyer has a problem
Open the Sales page of your bot. Every payment has a row with the buyer, the item, the amount and the date. Reply sends a message to the buyer through your bot, even if they have no public username, which is the fastest way to resend a key or help with activation. Refund returns the Stars in one click if a key really did not work. If a buyer deleted the chat and lost their key, find it in the recently given list or the CSV and send it again with Reply.
Pricing tips
- Use round Stars prices such as 100, 250, 500 or 1,000. They read naturally to people who buy Stars in packs.
- Calculate your income with the developer rate. Telegram's terms set the reward for bot owners at the equivalent of 0.013 USD per Star, so a 250-Star key earns you about 3.25 USD, not the retail price the buyer paid for the Stars.
- Make longer tiers clearly cheaper per day. A 30-day key that costs the same as four 7-day keys gives nobody a reason to commit.
- Keep an entry-level tier. A cheap 1-day key lets new buyers try you out and is often what turns into repeat purchases.
See your bot live in one minute, no token needed
TeleMinute lends you a demo bot for 15 minutes, with no card and no BotFather step. Build your first command, message your bot, and add your own token when you are ready to start selling keys.
Try a demo bot, no token neededFrequently asked questions
Can the same key ever be sold to two people?
No. Each key can be given out once. The key is marked as used in the same database operation that assigns it, so two payments arriving at the same second still get two different keys. A key that has been given out can never return to the pool, even if you upload the same file again, and the same key cannot be added to two different commands of one bot.
What happens when my keys run out?
The buy button disappears and buyers see an out of stock note instead, so nobody can pay for a key that does not exist. If two people pay for the very last key at the same moment, the second payment is refunded automatically. You get a Telegram notification when 3 keys are left and again when the stock hits zero.
What file format do I need for my keys?
A plain .txt file with one key per line, or you can paste the keys straight into the editor. Empty lines and extra spaces are ignored, duplicate lines are skipped, and each key can be up to 500 characters. One upload can hold up to 5,000 keys and you can upload as many times as you like.
Do I need to write code to sell keys on Telegram?
No. With TeleMinute you turn on Paid content on a command, set the price in Stars, choose Keys as the delivery type and upload your list. Invoices, payment checks, key assignment, stock tracking and refunds are handled for you. Paid features require a Premium plan.