Guide · Telegram Stars

Delivering digital goods after a Telegram Stars payment: files, keys and links

Delivering digital goods after a Telegram Stars payment: sending files, licence keys and access links, expiring links, re-delivery and what to do when delivery fails.

Published:

Delivering digital goods after a Telegram Stars payment: files, keys and links

Delivering digital goods after a Telegram Stars payment works best when the item reaches the buyer in the same chat within seconds, can be sent again on request, and cannot easily be shared with people who did not pay. In practice that means three patterns: send the file directly, send a unique key or code, or grant access through a personal link. This guide explains when to use each one and how to handle re-delivery and failures.

What you need before you start

  • A recorded payment for every order. Delivery should start only after your bot has stored the successful_payment update with its telegram_payment_charge_id. How to do that safely is covered in our Stars invoice guide.
  • A product catalogue with delivery types. For each product, note whether it is a file, a key, an access link or a feature inside your bot.
  • Storage for delivered items. Keep a record of what each buyer received, so you can send it again later.
  • A support entry point. A working /paysupport command for buyers who did not receive their item.

Step-by-step: a delivery flow that works

  1. Look up the order. Use the invoice_payload from the payment to find the product and the buyer.
  2. Prepare the item. Pick the file, reserve a key from your pool, or create a personal access link.
  3. Send it in the chat. Send the file or message to the buyer from the bot. Add one line that explains what they received and how to use it.
  4. Record the delivery. Save what was sent, when, and the message or file identifier. Mark the order as delivered.
  5. Offer re-delivery. Tell the buyer how to get the item again, for example with a "My purchases" button or command.
  6. Watch for failures. If sending fails, retry after a short delay. If it keeps failing, alert yourself and tell the buyer that the item is delayed.

Options and settings explained

Delivery typeHow to sendGood forWatch out for
File in the chatsendDocument, sendAudio or sendVideo; reuse the stored file_idE-books, templates, music, presetsFiles can be forwarded; consider protected content where it fits
Unique key or codeA text message with a key taken from your poolSoftware licences, vouchers for your own serviceNever give the same key twice; mark it as used immediately
Personal invite linkcreateChatInviteLink with a member limit or expiryPrivate channels and groups with paid contentRevoke unused links; check membership on renewals
Feature inside the botUpdate the user's record and confirm in a messageCredits, premium modes, extra limitsShow the new balance so the buyer sees the change
External account accessLink the Telegram user to an account on your siteWeb tools and SaaSUse a secure, one-time login link

Expiring and personal links

When access is given through a link, make it personal and short-lived. For a private channel, an invite link with a member limit of one and an expiry date stops it from being shared widely. For downloads hosted on your own server, use signed URLs that expire after a short time, and create a new one each time the buyer asks. Keep the permanent copy in the chat, where only the buyer can see it.

Protected content

The Bot API lets bots send messages with protected content, which prevents forwarding and saving in Telegram apps. It does not make copying impossible, but it reduces casual sharing. Tell buyers in advance if files cannot be saved, so they are not surprised.

Re-delivery on request

Buyers lose files, change phones or delete chats. A simple "My purchases" command that lists past orders and sends each item again saves many support messages. Because you stored the file_id or the key, re-delivery is instant and does not need a new payment.

Common mistakes and how to avoid them

  • Sending a public link. A permanent public download link will be shared. Use the chat itself or personal, expiring links.
  • Reusing keys. If two buyers get the same licence key, both will complain. Reserve keys in a transaction and mark them used at once.
  • No instructions. A file with no explanation leads to "how do I open this?" messages. Add one or two lines of guidance.
  • Delivery only in the mini app. If your mini app shows the item but the bot does not send a copy, buyers lose it when they close the app. Send a chat message too.
  • Ignoring failed sends. Users who blocked the bot or deleted the chat cannot receive messages. Detect the error and show the item the next time they open the bot.

When delivery fails completely

If you cannot deliver, for example because the product is no longer available, tell the buyer quickly and refund the payment with refundStarPayment. Do not leave a paid order without a clear answer. Buyers' rights and expectations are summarised in our refund and /paysupport guide, and the rules for selling digital goods are in this article.

Where PayStars fits

If the item you deliver is itself Telegram Stars or Premium, for example as a reward, you do not need to send files at all. The PayStars API delivers Stars or Premium directly to a public @username, checks the username before ordering, and returns a TxId for every order.

FAQ

How should a bot deliver a file after a Stars payment?

Send it in the chat with sendDocument or a similar method, and store the returned file_id so you can send it again instantly later.

How do I sell access to a private channel for Stars?

After payment, create a personal invite link with createChatInviteLink, limited to one member or with an expiry date, and send it to the buyer.

Can I stop buyers from forwarding paid files?

Bots can send protected content, which blocks forwarding and saving in Telegram apps. It reduces sharing but cannot prevent every copy.

What if a buyer loses the item?

Offer a My purchases command that lists past orders and re-sends each item from your stored records, without a new payment.

What should I do if I cannot deliver at all?

Tell the buyer promptly and refund the payment with refundStarPayment using the stored charge ID.

Sources

Buy Stars and Premium with USD (USDT)

Via API key: 0% (plain Fragment price). Via the website: 5%.

Get started