How to use Stripe as Paywall for Telegram bot workflow?

Is there a tutorial or workflow that teaches how to integrate Stripe as a Paywall for my Telegram Bot? I need to handle montly/yearly subscriptions so that the users can only access the main features of the bot if they paid and have a valid subscription.
Anything I could look into?

Information on your n8n setup

  • n8n version: 2.25.7
  • Database (default: SQLite): Yes
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux Mint
1 Like

Hi @Federico_Gentile

These may help

1 Like

Those templates cover checkout notifications; the missing part for Federico’s bot is the access gate. Keep a small subscription table keyed by Telegram chat_id/user id plus Stripe customer and subscription, then check that row before each paid command instead of trusting one checkout event forever.

Federico, do users start in Telegram before paying, or do they land on a web page first and connect Telegram after checkout? That decides whether the clean link is a /start deep link from the bot or a Stripe Checkout link the bot sends.

1 Like

Thank you for the prompt reply. So the idea for now is that the user gets to the Telegram bot directly either by searching for it or sharing the link. Once there, the users will have 2 commands available:

  1. /list → which gives some info about the services which I want to sell
  2. /subscribe → which allows the user to pay the monthly/yearly subscription via Stripe.
    Once the payment is done, the user can interact with the rest of the commands and have access to the full service.

Currently I would like to do such implementation trying to minimize mistakes and avoid to re-invent the wheel if possible since I am not so familiar with this technology (I know a bit of everything but not super in details).

Welcome @Federico_Gentile!

The architecture @oimrqs_ops described is the right approach. One thing to add: hook a Webhook node to Stripe’s customer.subscription.updated and invoice.payment_failed events so your subscription table stays in sync automatically - otherwise you’ll have users accessing paid features after their subscription lapses. In n8n, set the Webhook URL in your Stripe dashboard under Developers > Webhooks, then use a Switch node to branch on event.type and update the user’s status in your DB accordingly. That way the gate check in your bot is just a simple DB lookup without needing to call the Stripe API on every message.

That /subscribe shape is the clean one. Make /subscribe create a Stripe Checkout Session with the Telegram chat_id in client_reference_id or metadata, then let the Stripe webhook grant access after checkout.session.completed / the subscription is active; don’t unlock from the redirect alone.

Keep /list free and make each paid command do one access-table lookup before it runs. Federico, what are you using for that table already: Postgres, SQLite, Sheets, or something else?

1 Like

Thank you @oimrqs_ops and @nguyenthieutoan for you contributions. I will give ti a shot now that I have a clearer direction. Hopefully if i make it I will make a tutorial out of this because I think it is a pretty useful usecase. Surprised that there is not so much info about it though.

@Federico_Gentile Focus your outreach on delivering high-value automation ecosystems—n8n, AI, Make.com, and GHL—to ensure your clients experience seamless, revenue-generating growth