- Platform: YouTube
- Channel/Creator: Building With Bubble
- Duration: 00:48:59
- Release Date: Sep 29, 2022
- Video Link: https://www.youtube.com/watch?v=EAhrfR62q1c
Disclaimer: This is a personal summary and interpretation based on a YouTube video. It is not official material and not endorsed by the original creator. All rights remain with the respective creators.
This document summarizes the key takeaways from the video. I highly recommend watching the full video for visual context and coding demonstrations.
- I summarize key points to help you learn and review quickly.
- Simply click on
Ask AIlinks to dive into any topic you want.
Teach Me: 5 Years Old | Beginner | Intermediate | Advanced | (reset auto redirect)
Learn Differently: Analogy | Storytelling | Cheatsheet | Mindmap | Flashcards | Practical Projects | Code Examples | Common Mistakes
Check Understanding: Generate Quiz | Interview Me | Refactor Challenge | Assessment Rubric | Next Steps
You’ll end up with a complete subscription system where:
- New or non-paying users hit a paywall and are forced to subscribe.
- Users pick monthly or yearly plans and pay via Stripe Checkout.
- Users can upgrade, downgrade, or cancel anytime through Stripe’s customer portal.
- Your Bubble database stays perfectly in sync even when users make changes inside Stripe. All of this without writing a single line of code.
Ask AI: Stripe Subscriptions in Bubble.io Overview
- Sign up / log into stripe.com (test mode is fine while building).
- Go to Products → Create product.
- Create two recurring prices:
- Monthly Magic – £40/month (recurring, monthly interval)
- Annual Magic – £400/year (recurring, yearly interval)
- Save each product and copy the Price ID for each one (you’ll see it on the price detail page, e.g. price_1LHiCy…).
Ask AI: Creating Recurring Prices in Stripe
Install these two official plugins:
- Stripe (by Bubble)
- Stripe Customer Portal
In the Stripe plugin settings (development tab):
- Publishable key → your test publishable key
- Secret key → your test secret key
- Client ID → found in Stripe → Developers → Multi-party payments → Testing → “Test your development client ID”
In the Stripe Customer Portal plugin:
- API key → Bearer + your test secret key (format: Bearer sk_test_…)
Make sure Stripe Checkout version is set to v3.
Ask AI: Configuring Stripe Plugins in Bubble
Create a new data type called Payments with these fields (all text except dates):
- Last payment date (Date)
- Payment frequency (text – “month” or “year”)
- Product ID (text – the Stripe Price ID)
- Stripe Customer ID (text – auto-filled by Stripe)
- Subscription end date (Date)
- Status (text – “active” or “canceled”)
Keep it as a separate table (not on User) for flexibility and cleaner privacy rules.
Ask AI: Bubble Database Structure for Stripe Subscriptions
On your subscription page:
- Dropdown (option set) → “Monthly” / “Yearly”
- “Subscribe” button → Start/Edit workflow
Workflow (monthly example):
- Plugins → Stripe - Subscribe user to plan → choose the monthly Price ID
- Untick “Create new customer if none exists” (we let Stripe handle it)
- No trial period in this demo
- Only when result of step 1’s status is “active” → Make changes to a thing → Create a new Payments
- Last payment date = Result of step 1: Current period start
- Payment frequency = Result of step 1: Interval
- Product ID = Result of step 1: Plan ID
- Stripe Customer ID = Result of step 1: Customer ID
- Subscription end date = Result of step 1: Current period end
- Status = Result of step 1: Status
- Still only when step 1 is active → Go to page “App” (or dashboard)
Duplicate the workflow for yearly, just change the Price ID. Add a condition on the button so the correct workflow runs based on the dropdown value.
Ask AI: Stripe Checkout Workflow in Bubble
When a user logs/signs up:
- Go to page “App” only when Search for Payments (Created by = Current User, first item)’s Status is “active”
- Otherwise → Go to page “Subscription”
This automatically redirects non-subscribers to the paywall.
Ask AI: Creating a Paywall in Bubble
In Stripe Dashboard → Customer portal → Configuration:
- Allow customers to update subscription and cancel subscription
- Add both of your prices so they can switch between them
- Save
In Bubble, add a “Manage subscription” button:
- Plugins → Stripe Customer Portal → Create portal session (use Current User’s Payments → Stripe Customer ID)
- Account → Open external website → Result of step 1: URL
Add your app’s return URL in the plugin settings (e.g. your dashboard page) so users can come back after changes.
Ask AI: Stripe Customer Portal Setup
Without a webhook, canceling or upgrading inside the portal won’t update your Bubble DB → users keep access.
Steps:
- Backend workflows → API workflows → New API workflow → name it “stripe-webhook”
- Tick “Expose as a public API” and “This workflow can be run without authentication”
- Click “Detect request data” → copy the endpoint URL
- In Stripe → Developers → Webhooks → Add endpoint → paste the Bubble URL
- Select events:
- customer.subscription.updated
- customer.subscription.deleted
- Test a subscription + cancel → go back to Bubble → click “Detect data” → save
- Remove “/initialize” from the endpoint URL in Stripe and update the endpoint
- In the workflow add action “Make changes to a thing”:
- Thing to change = Search for Payments: Stripe Customer ID = Request Data’s object → customer : first item
- Last payment date ← Request Data → object → current_period_start (Unix)
- Payment frequency ← Request Data → object → plan → interval
- Product ID ← Request Data → object → plan → id
- Status ← Request Data → object → status
- Subscription end date ← Request Data → object → current_period_end (Unix)
Now every change in the portal instantly reflects in your Bubble database.
Ask AI: Stripe Webhook to Bubble Backend Workflow
- Test everything in test mode with cards like 4242 4242 4242 4242
- Add extra logic on page load to kick users out if status ≠ active
- You can add more webhook events later (payment failed, invoice paid, etc.)
- Consider separate “basic” vs “premium” privacy rules or groups for more complex plans
That’s the entire flow. Once you’ve followed these steps you’ll have a rock-solid subscription system that handles signup, upgrades, downgrades, cancellations, and keeps your data perfectly in sync.
About the summarizer
I'm Ali Sol, a Backend Developer. Learn more:
- Website: alisol.ir
- LinkedIn: linkedin.com/in/alisolphp