Appearance
How to Sell Access in Telegram via Stripe
Quick Summary (TL;DR):
- Goal: Restrict access to specific content, downloads, courses, or bot features until a user completes a Stripe payment.
- Time to set up: ~10 minutes.
- Key Requirements: A Stripe account (for API keys) and a published bot.
- Related Guide: Products & Payments Configuration
The Scenario: How an automated paywall works
Selling digital access manually is slow and prone to errors. With TeleGo.io, you can build a fully automated system:
When a user clicks your payment button, they are redirected to a secure Stripe Checkout page. Once they pay, Stripe notifies your bot via webhook, TeleGo tags the user, and the flow continues automatically to deliver the content.
Step 1: Connect Stripe to your Workspace
To accept credit cards and local payment methods, you must link your Stripe account:
- Open Workspace Settings ➔ Payments.
- Check the box for Enable Stripe payments.
- Retrieve your API keys from your Stripe Dashboard:
- Copy your Publishable Key (starts with
pk_live_orpk_test_) and paste it into the Publishable Key field. - Copy your Secret Key (starts with
sk_live_orsk_test_) and paste it into the Secret Key field.
- Copy your Publishable Key (starts with
- Copy the Stripe webhook URL displayed in the settings modal.
- In your Stripe Dashboard, go to Developers ➔ Webhooks ➔ Add Endpoint:
- Paste the webhook URL you copied.
- Select the following events to listen to:
checkout.session.completedandcheckout.session.expired. - Copy the generated Webhook Signing Secret (starts with
whsec_...) and paste it back into TeleGo's Webhook Signing Secret field.
- Click Save Stripe Settings and verify by clicking Test Connection.
WARNING
Always keep your Stripe Secret Key and Webhook Secret private. They are encrypted at rest in your TeleGo workspace database.
Step 2: Create a Stripe Product
Now define what you are selling:
- Navigate to Workspace Settings ➔ Products & Payments.
- Click Create Product.
- Choose Stripe (Card / USD) as the provider. (Note: The provider cannot be changed after creation).
- Fill in the product details:
- Name: The title displayed to users at checkout (e.g., "Premium Course Access").
- Price: Enter the price in USD (e.g.,
19.99). - Stripe Product/Price ID (Optional): If you already configured this product in Stripe, enter its IDs to match. Otherwise, TeleGo will generate them automatically.
- Click Save. The product will now appear as Active in your table.
Step 3: Build the Paywall in the Scenario Editor
Now configure your bot's conversation flow to prompt for payment and check the result:
1. Create the Offer Message
- Drag a Message Node onto the canvas (name it "Offer Pitch").
- Write your sales copy explaining what the user gets.
- Add a button at the bottom of the card:
- Label: e.g., "Pay $19.99 💳"
- Action: Select Payment.
- Product: Choose the Stripe product you created in Step 2.
2. Tag the user after payment
- Connect the payment button's
nextlink to an Actions Node. - Add action:
tag.add→ tag namepaid_premium(or any consistent name). - This action runs immediately after Stripe confirms the payment.
3. Deliver the content
- Connect the Actions Node's
nextlink to a Message Node containing the premium content.- Example: "Thank you for your purchase! Here is your download link: Download Guide"
- The user reaches this message only after successful payment — no extra condition check needed.
Checking payment status later
If you need to gate access in a different part of your flow, add a Condition Node with rule has tag: paid_premium. True branch = paid users, False branch = prompt to pay.
Step 4: Publish and Test
- Click Publish in the scenario editor toolbar to push the flow live.
- Open your Telegram bot and run the scenario (by typing the trigger command, e.g.,
/startor/premium). - Click the payment button. You will be redirected to the Stripe Checkout page.
- If testing, use Stripe's test keys and test card numbers to simulate a successful purchase.
- Confirm that the bot unlocks the premium message instantly after payment.