By Stendly3 min read

How to accept stablecoin payments in a Telegram bot

A practical payment flow for Telegram bots that sell subscriptions, credits or digital access.

A Telegram bot can accept stablecoin payments without asking the user to send a transaction hash to support. The bot creates or opens a checkout, attaches the Telegram user ID as a reference and waits for a signed payment event before granting access.

The correct implementation depends on how much trust the reference requires.

For a fixed plan, the bot can send a reusable payment link:

https://app.stendly.com/p/pl_example?client_reference_id=tg_123456

After payment, the gateway returns the reference in a webhook. The merchant uses it to find the Telegram account and grant a role, credits or subscription time.

The reference is visible in the URL. A user can change it and pay for another account. That may be acceptable for a giftable subscription, but it is not suitable when the payment unlocks private data or an existing order.

Trusted checkout flow

For a trusted binding, the bot backend creates a checkout session through an authenticated API. It sends the Telegram user ID or internal account ID from server-side code, receives a one-time URL and returns it to the chat.

The buyer cannot replace the trusted reference by editing the browser URL. The backend also controls the exact price, order and return page.

Do not grant access from the browser

A success page can be closed, refreshed or forged. The bot should wait for the payment provider's signed webhook. The handler verifies the signature, checks whether the event was processed and updates the user's entitlement.

A typical record contains the Telegram user ID, price ID, payment event ID, access expiration and transaction reference.

Telegram Stars or stablecoins

Telegram Stars are native to the Telegram ecosystem and may be the simpler choice for digital goods sold entirely inside Telegram, subject to Telegram and platform rules. Stablecoins can be useful when the product also has a web app, serves crypto-native users or needs settlement outside the Stars model.

A product can support both. The merchant should not force crypto on users who prefer the native Telegram purchase flow.

What Stendly provides

Stendly offers reusable payment links, server-created checkout sessions and signed webhooks. The same billing layer can represent one-time access, account credits or recurring plans.

A bot can begin with one public link and later move to an API-created session when it needs a trusted user binding. Node.js, Python and .NET SDKs are available, but a simple payment link does not require an SDK.

Example webhook logic

if (event.type === "payment.succeeded") {
  const userId = event.data.clientReferenceId;
  await grantTelegramAccess(userId, event.data.priceId);
}

Production code also needs signature verification, idempotency and validation that the expected price was paid.

Sources

Telegram Bot Payments

Telegram Stars

Stendly documentation