Refunding a Telegram Stars payment as a developer: when and how
Refunding a Telegram Stars payment as a developer: when to refund, how refundStarPayment works, what to log, how to tell the user and how to limit abuse.
Published:

Refunding a Telegram Stars payment as a developer takes one Bot API call: refundStarPayment with the buyer's user ID and the telegram_payment_charge_id of the original payment. The harder part is deciding when to refund, keeping your records correct, and explaining the result to the user. This article covers the decision, the technical steps, logging and how to keep refunds from being abused.
Short answer in plain words
When a user pays your bot in Stars, Telegram sends a successful_payment update that contains a unique charge ID. If you later decide to return the payment, you call refundStarPayment with that charge ID and the user's ID. The Stars go back to the user's balance, and the payment is marked as refunded. You can only refund the specific payment you received, and you need the charge ID to do it, so store it for every order.
Users usually ask for refunds through /paysupport. Telegram's general rules for buyers are explained in our /paysupport and refund guide; this article is about what you do on the developer side.
How it works, with an example
- The payment arrives. Your bot receives
successful_payment. You save the user ID, theinvoice_payload(your order reference), the amount in Stars and thetelegram_payment_charge_id. - A problem is reported. The user sends
/paysupport: "I paid for the PDF guide, but the file did not open." - You check the order. You find the order by user ID or reference, confirm the payment and look at the delivery log. The file link was broken for an hour.
- You decide. Re-delivery fixes the problem for most users, so you offer a working link first. The user prefers a refund, which your policy allows for failed deliveries.
- You call the method.
refundStarPaymentwithuser_idandtelegram_payment_charge_id. On success, the API returnstrue. - You update your records. Mark the order as refunded, remove access to the item if it was delivered, and log who approved the refund and why.
- You tell the user. "Your refund of 100 Stars has been sent to your Telegram balance. Sorry for the trouble."
If the call fails, read the error description returned by the API. Typical reasons are a wrong charge ID, a payment that was already refunded, or a problem with the bot's balance. Do not tell the user the refund is done until the call has succeeded.
What it means for developers
When to refund
| Situation | Usual action | Notes |
|---|---|---|
| Paid, item not delivered | Deliver now or refund | Check your logs first; delivery may have succeeded |
| Item does not work as described | Fix, replace or refund | Ask for details or a screenshot |
| Duplicate payment by mistake | Refund the extra payment | Keep the first, refund the second |
| Changed mind after full use | Usually decline politely | Follow your published policy |
| Subscription the user forgot to cancel | Case by case | Cancel future renewals in any case |
What to log
- The charge ID, user ID, amount and date of the original payment.
- The date and reason for the refund request, and the decision.
- Who approved it, if several people handle support.
- The API response, including any error description.
A complete log lets you answer questions later, spot repeated requests from the same account and reconcile your records with Telegram's transaction history, which bots can read with getStarTransactions.
Communicating with the user
Reply in the language the user wrote in, keep the message short, and state the result clearly: approved or declined, the amount and where the Stars went. If you decline, explain the reason in one sentence and offer an alternative, such as re-delivery or help using the item.
Common misconceptions
- "Telegram refunds for me automatically." Refunds for your bot's sales are your decision and your action through the Bot API.
- "I can refund part of a payment." The method refunds a specific payment by its charge ID. If you want to compensate partially, consider giving extra in-app value instead, and explain it clearly.
- "I can find the charge ID later." Store it at the moment of payment. Rebuilding it afterwards is difficult and error-prone.
- "Refunding is always the safest choice." Fast refunds are good service, but automatic refunds without checks invite abuse.
Preventing refund abuse
- Revoke access to the item when you refund, so the same content cannot be kept for free.
- Limit the number of refunds per account in a period, and review accounts that exceed it.
- For consumable items, refund only the unused part of a pack by policy, or decline after full use.
- Keep the policy public and apply it the same way to everyone.
Practical next steps
- Check that your
successful_paymenthandler stores the charge ID for every order. - Build a small internal command or admin page that looks up an order and calls
refundStarPayment. - Write reply templates for approved and declined refunds in the languages your bot supports.
- Read the full payment flow in our guide to Stars invoices.
If your project also sells Stars or Premium to users through the PayStars API, note that failed PayStars orders are returned to your USD balance automatically, so no manual refund call is needed there.
FAQ
Which method refunds a Telegram Stars payment?
The Bot API method refundStarPayment. It takes the user's ID and the telegram_payment_charge_id from the original successful_payment update.
Can I refund only part of a Stars payment?
The method refunds a specific payment identified by its charge ID. For partial compensation, many developers give extra in-app value instead and explain it clearly.
Where do the refunded Stars go?
They return to the Telegram Stars balance of the user who made the payment.
What if refundStarPayment returns an error?
Read the error description. Common causes are a wrong or already refunded charge ID. Tell the user only after a successful call.
Should I remove access after a refund?
Yes, in most cases. Revoking access to the refunded item keeps the process fair and reduces abuse.
Sources
Buy Stars and Premium with USD (USDT)
Via API key: 0% (plain Fragment price). Via the website: 5%.
More news
How to price a Telegram channel subscription in StarsHow to price a Telegram channel subscription in Stars: define your value, compare similar channels, use separate channels as tiers and offer fair trials.Read →
Designing a Stars economy for a Telegram game bot: basics for developersHow to design a fair Stars economy for a Telegram game bot: currency sinks, honest pricing, avoiding pay-to-win, refunds and clear rules for players.Read →
Handling successful_payment reliably in a Telegram Stars botHow to handle successful_payment reliably in a Telegram Stars bot: idempotent orders, storing the charge ID, retries, crash recovery and daily reconciliation.Read →