TG-Staff 团队 avatar TG-Staff 团队

Complete Guide to Telegram Bot Stars Payments: Digital Goods, Subscriptions, and Bot API Integration Scenarios

telegram-bot stars payment digital goods

Telegram Bot Stars Payment Ultimate Guide: Digital Goods, Subscriptions, and Bot API Integration Scenarios

If you run a Telegram Bot and want to sell digital goods or provide paid subscriptions to users without relying on third-party payment platforms, Telegram Bot Stars Payment is an official solution worth considering. Stars are a virtual currency introduced by Telegram. Users purchase them through official channels and can spend them within bots to unlock content, buy virtual items, or subscribe to services. This article will detail the applicable scenarios, implementation steps, and limitations of Stars payment from the perspective of Bot API integration, and compare it with external SaaS payment solutions like Stripe/USDT to help you plan the most reasonable payment strategy.

What is Telegram Bot Stars Payment?

Telegram Stars (also known as “stars”) are a virtual currency launched by Telegram. Users can purchase them in-app (via App Store, Google Play, or Fragment, etc.) and spend them in bots that support Stars. Stars payment is integrated through the Bot API: developers need to enable Payments in BotFather and select “Telegram Stars” as the payment provider, then call the sendInvoice method to send an invoice.

Simply put, Stars payment allows bot developers to achieve small, instant, high-trust digital goods transactions without building their own payment system or integrating external platforms like Stripe/PayPal. However, note that Stars are limited to digital goods (e.g., e-books, memberships, virtual items) and cannot be used for physical goods or offline services.

Applicable Scenarios for Stars Payment

Stars payment is suitable for the following typical scenarios:

  • Digital content unlocking: Users pay Stars, and the bot automatically sends PDF, course links, videos, or audio files.
  • In-bot subscriptions: e.g., premium notifications, ad-free experience, exclusive data analysis reports. Note: Stars payment does not support automatic deductions; the bot must manually handle renewals.
  • Virtual item purchases: in-game items, sticker packs, avatar frames, etc.
  • Paid features: advanced search, batch processing, API access, etc.

Not supported: physical goods, offline services like food delivery/ride-hailing, withdrawal to fiat currency (requires official exchange channels).

Advantages and Limitations of Stars Payment

AdvantagesLimitations
High user trust (official payment channel, no need to enter bank card)Digital goods only
No external payment platform needed, simple integrationCannot directly withdraw to fiat currency (need to exchange to TON or via third party)
Instant settlement, bot receives notification immediately after user paymentNo automatic refund dispute handling
Transparent Telegram commission (see official docs)Not suitable for large transactions or long-term subscription cycle management

How to Integrate Stars Payment via Bot API?

Core steps for integrating Stars payment (based on Bot API 6.9+):

  1. Enable Payments in BotFather: Send /mybots → Select your bot → “Payments” → Select “Telegram Stars” as the provider.
  2. Call the sendInvoice method: Parameters include title, description, payload (custom data), currency (must be set to "XTR"), prices (Stars integer, e.g., [{"label": "电子书", "amount": 10}]).
  3. Handle callbacks: Listen for pre_checkout_query (pre-checkout query, need to call answerPreCheckoutQuery to confirm) and successful_payment (successful payment, then unlock the product).

Note

Stars payment currently only supports currency: "XTR", and the price unit in the prices array is an integer of Stars, decimals are not supported. For example, amount: 10 means 10 Stars.

Pseudocode example (Python-style):

# 发送发票
bot.send_invoice(
    chat_id=user_id,
    title="高级会员 - 7天",
    description="解锁所有高级功能",
    payload="premium_7d_001",
    currency="XTR",
    prices=[{"label": "会员", "amount": 50}]
)

# 处理成功支付
@bot.on_successful_payment()
def on_payment(payment):
    user_id = payment.from_user.id
    # 记录用户有效期,解锁功能
    grant_premium(user_id, days=7)

Typical Applications of Stars Payments: Digital Goods and Bot Subscriptions

Digital Goods

After a user pays with Stars, the bot automatically sends files, links, or unlocks features. For example:

  • The user sends /buy_ebook, and the bot sends an invoice for 10 Stars.
  • Upon successful payment, the bot sends a PDF download link (or directly sends the file in the chat).
  • The logic is simple, requiring no state management, making it suitable for one-time purchases.

Bot Subscriptions

Stars payments do not support automatic deductions, so subscriptions must be manually renewed via the bot:

  • A user pays Stars for a 7-day membership, and the bot records the expiration time (e.g., expire_at).
  • Before expiration, the bot sends a reminder message and a renewal invoice.
  • After the user pays again, the bot extends the validity period.

This model is suitable for lightweight subscriptions (such as weekly/monthly memberships), but it is not suitable for complex scenarios requiring auto-renewal, tiered pricing, or team management.

Stars Payments vs. External SaaS Subscriptions (Stripe/USDT) — How to Divide the Work?

For teams that manage both digital goods and long-term subscriptions, a reasonable division of labor can improve efficiency:

Comparison DimensionStars PaymentsExternal SaaS (e.g., TG-Staff’s Stripe/USDT)
Suitable ProductsDigital goods, small instant purchasesLarge transactions, auto-renewal subscriptions
Payment MethodsIn-app purchase (Stars)Credit card, USDT (TRC20)
Auto-RenewalNot supported (requires manual renewal)Supported (Stripe auto-debit)
Refund HandlingNo automatic refundsSupports refunds, invoice management
Compliance AuditingNo built-in controlsSupports content moderation (e.g., wallet address monitoring)
Multi-Project ManagementSingle botMulti-bot, multi-agent permission control

Best Practices

For teams operating both in-bot digital goods and long-term subscriptions, a combinable approach: use Stars for one-time purchases (e.g., e-books) and external SaaS for monthly/annual subscriptions (e.g., premium customer service packages), leveraging the strengths of each.

When to Choose Stars Payment?

  • Low unit price (e.g., 1–50 Stars, ~0.1–5).
  • Small user base, no need for refund mechanism.
  • Simple bot functionality, requiring only a one-time unlock.
  • Example: Paid unlocking of bot sticker packs, one-time data analysis reports.

When to Choose External SaaS Payment?

  • High unit price (e.g., $20+), or requires auto-renewal.
  • Multi-agent collaboration, compliance monitoring (e.g., TG-Staff’s content moderation can detect if agents mistakenly send wallet addresses).
  • Needs refund and invoice management.
  • Example: TG-Staff Pro subscription (includes unlimited translation, user profiling, internal control management).

Considerations for Implementing Stars Payment

  1. Stars Withdrawal: Requires conversion to Toncoin (TON) via Telegram’s official partners (e.g., Fragment), then to fiat currency. Be mindful of exchange rate fluctuations and fees.
  2. Refund Policy: Stars payment does not support automatic refunds. It is recommended to clearly state return and exchange rules in the bot’s product description and keep transaction logs for manual dispute handling.
  3. User Education: Some users may be unfamiliar with the Stars purchase process. Provide guidance within the bot, such as a “How to Buy Stars?” button linking to the official help page.
  4. API Limits: sendInvoice has rate limits (official specifics not disclosed); for high-frequency scenarios (e.g., flash sales), design queues or rate limiting.

Note

Refund disputes for Stars payments must be resolved between the developer and the user; Telegram does not intervene. It is recommended to set clear return and exchange policies within the bot and keep transaction logs.

FAQ

Q: Can Telegram Stars be withdrawn as fiat currency?
A: Yes. Telegram officially provides a channel to exchange Stars for Toncoin (TON), and it can also be exchanged for fiat currency through some third-party partners. For specific exchange rates and fees, refer to official announcements.

Q: Does Stars payment support subscription auto-renewal?
A: No, it does not support automatic deductions. Stars payment is a one-time invoice. Developers need to manually send new invoices via bot logic (e.g., tracking validity periods) for renewals. For auto-renewal scenarios, external payments like Stripe are recommended.

Q: What are the fees for Stars payment?
A: Telegram charges a certain percentage fee on Stars payments (typically between 5% and 30%, depending on product type and region). It is advisable to reserve profit margins when pricing.

Q: Can I use Stars to purchase TG-Staff plans?
A: No. TG-Staff currently only supports Stripe and USDT (TRC20) payments, not Telegram Stars. Stars payment is for digital goods within bots, while TG-Staff is an external SaaS platform.

Q: If a user requests a refund, can Stars be returned?
A: Stars payment does not support automatic refunds. Developers need to contact users directly to negotiate and handle manually via bot logic (e.g., reissuing goods or compensating Stars). It is recommended to clearly state refund policies within the bot.


Next Step: Build a Complete Payment System for Your Bot

If your bot needs to support both digital goods sales and long-term subscription management, consider combining Stars payment with an external SaaS solution. For example:

  • Use Stars for one-time content unlocks.
  • Use TG-Staff (supporting Stripe/USDT) for monthly/annual subscriptions, while leveraging its professional features like session routing and content moderation (e.g., wallet address monitoring) to enhance team efficiency and compliance.

Visit the TG-Staff website now to learn about plans, or go to the Dashboard to sign up for a 3-day free trial. For integration issues, contact our Support Bot for real-time assistance.