Home › All prompts › Subscriptions and Paywalls: Gate Features by Plan
Mini pack
Free
Subscriptions and Paywalls: Gate Features by Plan
You've got a free plan and a Pro plan. People can subscribe, and Stripe takes the payment. On the surface, it works. These 9 free prompts help you write down what each plan gets, keep your database in step with Stripe, lock paid features on the server and not just on the button, and make sure upgrades, cancellations, trials and failed payments change access the way you meant.
Write down what each plan gets, keep your database in step with Stripe, lock paid features on the server and not just on the button, and make sure upgrades, cancellations, trials and failed payments change access the way you meant.
9 prompts in 4 sections. Replace everything in [BRACKETS IN CAPS], then copy and paste into your AI tool.
Cursor's Agent or Claude Code with the project open, or the chat in Lovable, Bolt or v0, plus the Stripe Dashboard: all 9 prompts explain first and change nothing until the reader says "go"; 1.1 and 3.1 change no code at all. Every prompt that touches Stripe uses a sandbox (test mode) and never asks for keys. 1.1 turns plans into named entitlements in one table; 1.2 plans a subscriptions table (Stripe customer and subscription IDs, status as sent, price ID, period end, cancel settings, trial end, first failed payment) that only the server can write, with Supabase Row Level Security if used. 2.1 checks the webhook signature first, handles customer.subscription.created/updated/deleted, invoice.paid and invoice.payment_failed (plus trial and pause events when relevant) and re-fetches the latest subscription instead of trusting event order; 2.2 writes one server-side access function mapping every status (trialing, active, past_due with a grace period, unpaid, canceled, incomplete, incomplete_expired, paused) to entitlements. 3.1 audits every way around the paywall (screen-only checks, typed URLs, API routes, database writes, limits, background jobs); 3.2 puts one requireEntitlement-style check in front of every paid action. 4.1 adds a "Manage billing" button using Stripe's customer portal; 4.2 lines up trials and failed renewals with Stripe's retry and end-of-retry settings; 4.3 tests every plan change with test clocks and Stripe's test cards.
Stripe facts: subscription statuses and what each means; past_due after a failed renewal and the cancel, unpaid, past_due or pause outcome after the last retry; Smart Retries don't retry an incomplete first payment; subscription webhook events including trial_will_end (3 days before by default) and the entitlements summary event; cancel_at_period_end (cancel_at for flexible billing mode) and the updated/deleted events; current_period_end moved to subscription items in 2025-03-31.basil; customer portal features, settings, limitations, short-lived sessions, return_url and separate sandbox/live configs; trial end without a payment method (create invoice, cancel, pause); Stripe's own customer emails; test clocks, 4242 and 0341 test cards, synthetic stripe trigger data. Supabase: the secret key (service_role on older projects) bypasses RLS and stays on the server. All checked against docs.stripe.com and supabase.com docs on Dec 3, 2026.
Left out: default retry numbers and other time windows, trial parameter names (Stripe has two trial systems), prices, proration amounts, tax and fees, other billing providers, the X evidence post, and tool-specific Stripe integrations in Lovable, Bolt or v0 (not checked).
Not repeated here: Checkout, the webhook endpoint, duplicate events and going live point to Get Paid; refunds and out-of-order event logic to Get Paid 3.2; webhook signature checks to Ship It Safe 4.3; the RLS audit to Ship It Safe; login-protected pages to the Vibe Code Starter Pack 3.2.
No stats or X claims: no numbers beyond Stripe's own documented behaviour, no X posts quoted, and no affiliate or sponsor copy.
Written for use with Cursor's Agent, Claude Code, Lovable, Bolt or v0, plus the Stripe Dashboard. Not yet tested against them.
Use this when you have (or want) a free plan and a paid plan, but what each one includes is fuzzy or lives in several places. You get one clear list your code can follow.
Fill in: [MY APP IN ONE LINE], [MY PLANS] (e.g. "Free and Pro" or "Free, Pro and Team"), [WHAT I THINK EACH PLAN GETS] (e.g. "Free: 3 projects, no export. Pro: unlimited projects, PDF export"), [WHERE PLANS SHOW UP NOW] (e.g. "pricing page, settings page" or "not sure").
Don't change any code yet. Help me write down exactly what each of my plans includes, so my pricing page, my code and my database all agree.
My app: [MY APP IN ONE LINE]
My plans: [MY PLANS]
What I think each plan gets: [WHAT I THINK EACH PLAN GETS]
Where plans show up now: [WHERE PLANS SHOW UP NOW]
Please:
1. Search my code for every place that checks a plan, a "pro" flag, a subscription or a limit. List each one with the file and what it does.
2. Turn my plans into a list of entitlements: small, named things a plan allows, like "export_pdf" or "max_projects". Use limits (numbers) where something is "up to X", and on/off for features.
3. Give me a table: entitlement, what it means in plain English, and the value for each plan.
4. Point out anywhere my code, my pricing page and my list disagree, and anything a plan promises that my app doesn't actually do yet.
5. Ask me about anything unclear, like what happens to a user's extra projects if they drop from Pro to Free.
6. Suggest one file in my code where this table should live, so every check reads from the same place.
Tips to customize: Keep plan names out of your feature checks. "Can this user export a PDF?" survives a new Team plan. "Is this user Pro?" breaks the day you add one. Stripe also has its own Entitlements feature, where you attach features to products and Stripe sends an entitlements.active_entitlement_summary.updated event when a customer's features change. It's optional. Ask your AI to compare it with keeping the table in your own code before you pick one.
1.2 Store Plans and Subscriptions in My Database
Untested: not yet run against a model.
Use this when your app saves the plan as one yes/no field, or doesn't save it at all. You get a table that keeps the subscription facts Stripe sends you, so access can follow them.
Fill in: [TECH STACK] (e.g. "Next.js + Supabase"), [MY ENTITLEMENT TABLE] (paste the table from Prompt 1.1), [HOW USERS LOG IN] (e.g. "Supabase Auth", "Clerk" or "not sure"), [ONE SUBSCRIPTION PER] (e.g. "user" or "team").
Don't change anything until I say "go". Plan the database changes I need to store each customer's subscription the right way. Use Stripe's sandbox (test mode) for anything we try.
Tech stack: [TECH STACK]
My entitlement table: [MY ENTITLEMENT TABLE]
How users log in: [HOW USERS LOG IN]
One subscription per: [ONE SUBSCRIPTION PER]
Please plan:
1. Where to save the Stripe customer ID for each user (or team), so I always know which Stripe customer is which user.
2. A subscriptions table with: my user (or team) ID, the Stripe subscription ID, the subscription status exactly as Stripe sends it, the price ID, when the current paid period ends, whether it's set to cancel (cancel_at_period_end, or cancel_at on subscriptions that use Stripe's newer "flexible" billing mode), when a trial ends if there is one, when a renewal payment first failed (cleared once it's paid), and when I last updated the row from Stripe.
3. Check which Stripe API version my code uses. On newer versions, the current period end is on each subscription item (items.data[].current_period_end), not on the subscription itself. Tell me which one applies to me.
4. Who can change this table: my server only. Signed-in users may read their own row, but must never be able to write to it. If I use Supabase, plan Row Level Security policies for that, and keep the secret key (service_role on older projects), which skips those policies, on the server only.
5. Keep the plan-to-entitlement table from Prompt 1.1 in code, mapped by Stripe price ID, so a price ID becomes a list of entitlements.
6. What to do with any old "isPro" field: keep it until the new table works, then remove it in a separate step.
Show me the plan and the database changes, and wait for my "go".
Tips to customize: Save the status word Stripe sends (like past_due), not your own guess at what it means. Prompt 2.2 turns it into a yes or no in one place. If you're changing a database that already has real users, run the change past Safe Database Changes first. Saves That Stick helps if Row Level Security blocks your server's writes in a way you didn't expect.
Section 2: Keep Your App in Step With Stripe
2.1 Keep My Database in Step With Stripe Events
Untested: not yet run against a model.
Use this when someone cancelled, downgraded or stopped paying and your app never noticed, or when your app only saves the plan once, at checkout. You get a webhook handler that updates the subscription row every time Stripe changes it.
Fill in: [TECH STACK], [MY WEBHOOK FILE] (e.g. "app/api/stripe/webhook/route.ts" or "please find it"), [EVENTS I HANDLE NOW] (e.g. "only checkout.session.completed" or "not sure").
Look first and explain before changing anything. My app needs to keep each user's subscription in step with Stripe, not just at checkout. Work in Stripe's sandbox (test mode). Don't ask me to paste any keys or secrets.
Tech stack: [TECH STACK]
My webhook file: [MY WEBHOOK FILE]
Events I handle now: [EVENTS I HANDLE NOW]
Please:
1. Check that my webhook endpoint verifies Stripe's signature (using the raw request body and STRIPE_WEBHOOK_SECRET from an environment variable) before it does anything. If it doesn't, stop and tell me.
2. Handle these subscription events, and tell me in plain English what each one means: customer.subscription.created, customer.subscription.updated, customer.subscription.deleted, invoice.paid and invoice.payment_failed. Add customer.subscription.trial_will_end only if I offer trials, and customer.subscription.paused and customer.subscription.resumed only if subscriptions can pause.
3. For every one of these events, find the subscription ID (where it sits in an invoice event depends on my Stripe API version, so check Stripe's docs), fetch the latest version of that subscription from Stripe's API, and save its facts to my subscriptions table (status, price ID, period end, cancel settings, trial end). On invoice.payment_failed, save when the payment first failed if it isn't saved yet. On invoice.paid, clear it. Don't rely on the event arriving in order, or on the data inside an old event.
4. Match each subscription to my user using the Stripe customer ID I saved, never an email address.
5. Make the handler safe if the same event arrives twice, and reply to Stripe with a 2xx quickly.
6. Tell me which events to subscribe to for this endpoint in the Stripe Dashboard (in my sandbox first).
7. Explain how to test it with the Stripe CLI ("stripe listen --forward-to ..."), and remind me that "stripe trigger" makes its own test objects that aren't linked to my real users.
Show me the plan, then wait for my "go".
Tips to customize: Fetching the latest subscription each time is the simple way to stay correct when events show up late or twice. Stripe's docs warn that events don't arrive in a set order. If Get Paid's Prompt 2.3 already made your handler duplicate-safe, ask the AI to reuse that pattern. Customers can also change plans in the customer portal (Prompt 4.1). Those changes arrive as customer.subscription.updated, so this handler covers them too.
2.2 Turn Stripe's Statuses Into a Clear Yes or No
Untested: not yet run against a model.
Use this when you're not sure whether someone who is past_due, incomplete or trialing should get in, or your app checks the status differently in different places. You get one function that answers "what can this user do right now?"
Fill in: [TECH STACK], [MY GRACE PERIOD] (e.g. "keep Pro for 7 days after a failed renewal" or "help me choose"), [WHAT FREE USERS GET] (e.g. "the Free row from my entitlement table").
Don't change anything until I say "go". Help me write ONE server-side function that decides what a user can do right now, based on the subscription facts saved in my database.
Tech stack: [TECH STACK]
My grace period: [MY GRACE PERIOD]
What free users get: [WHAT FREE USERS GET]
Use Stripe's subscription statuses, and check each one against Stripe's "How subscriptions work" page:
- trialing: in a trial. Give paid access.
- active: in good standing. Give paid access.
- past_due: a renewal payment failed or wasn't attempted. Give paid access only until my grace period runs out, counted from when the payment first failed. After that, free access only.
- unpaid: Stripe has stopped trying to collect. Free access only.
- canceled: ended for good. Free access only.
- incomplete: the first payment hasn't gone through yet. Free access only, and show a "finish your payment" message.
- incomplete_expired: the first payment never went through. Free access only.
- paused: free access only until it resumes.
Also:
1. If the subscription is set to cancel at the end of the period, keep paid access until that date, then stop.
2. Compare saved dates with the current time, so access ends on its own when a paid period or grace period is over, even if no new event arrives.
3. If a status shows up that isn't on this list, give free access and log it, so I notice.
4. Return the user's entitlements (from my table in Prompt 1.1), not just "pro: true".
5. Write short tests for every status above, plus "cancels at period end, before and after the date" and "past_due, before and after the grace period ends".
Tips to customize: What your app does while a subscription is past_due is your choice. Make it match your Stripe settings: Stripe retries failed renewals on a schedule you set, then cancels it, marks it unpaid, leaves it past_due or pauses it, depending on the setting you chose. Prompt 4.2 lines the two up. If you use Get Paid's Prompt 3.2, keep its failure-date logic and let this function be the one place that reads it.
Section 3: Lock Paid Features on the Server
3.1 Find Every Way Around My Paywall
Untested: not yet run against a model.
Use this when you're worried a free user could reach paid features by typing an address, calling your API directly or changing something in the browser. You get a list of every gap, without changing any code.
Fill in: [TECH STACK], [MY PAID FEATURES] (e.g. "PDF export, more than 3 projects, the AI writer"), [MY ACCESS FUNCTION] (e.g. "getEntitlements() from Prompt 2.2" or "I don't have one yet").
Don't change any code. Review my app like someone trying to use paid features on a free account, and list every way they could get in.
Tech stack: [TECH STACK]
My paid features: [MY PAID FEATURES]
My access function: [MY ACCESS FUNCTION]
For each paid feature, check:
1. The screen: is the check only hiding a button or a menu item?
2. The page itself: can a free user open the page by typing its address?
3. The API routes or server functions behind it: do they check the user's entitlements on the server, or trust something the browser sends, like a "plan" value, a hidden field or local storage?
4. The database: can a signed-in user read or write paid-only data directly, or change their own plan or subscription row?
5. Limits: are limits like "3 projects" counted on the server when something is created, or only in the screen?
6. Anything paid that happens in the background, like scheduled jobs or emails, that never checks the plan.
Give me a table: feature, where the gap is (file and line), how someone could use it, how serious it is, and the fix. Put the most serious gaps first. Don't try any of these against my live site.
Tips to customize: Run this again every time you add a paid feature. If the review finds that users can read each other's data, that's a bigger problem than the paywall: fix it first with the Row Level Security audit in Ship It Safe. You can check a gap yourself on your own computer or a preview copy of your app: log in as a free test user and try the paid action from a second browser tab.
3.2 Lock Paid Features on the Server, Not Just the Button
In testing: automated checks only, see results below.
Automated test pass rate, 1 run on gemini-3.5-flash-lite, 2026-12-05
This prompt100%
Plain prompt80%
Use this when your paid-feature checks only live in the screen, or each page checks the plan its own way. You get one server-side check in front of every paid action, plus a friendly upgrade message.
Fill in: [TECH STACK], [MY GAPS] (paste the table from Prompt 3.1, or write "please find them"), [MY UPGRADE PAGE] (e.g. "/pricing").
Look first and explain before changing anything. Make my paywall real: every paid feature should be checked on the server, using one shared function.
Tech stack: [TECH STACK]
My gaps: [MY GAPS]
My upgrade page: [MY UPGRADE PAGE]
Please:
1. Use (or create) one server-side helper, like requireEntitlement(user, "export_pdf"), that calls my access function from Prompt 2.2. Every paid page, API route and server action should go through it. No feature should check the plan its own way.
2. Never trust a plan, price or entitlement value sent from the browser. Always look it up on the server for the logged-in user.
3. Count limits (like "up to 3 projects") on the server at the moment something is created, on every way it can be created (forms, copy or duplicate buttons, API routes, imports). Refuse the extra one the same way as step 4: say it needs the paid plan and link to my upgrade page, not just "limit reached".
4. When access is refused, return a clear "this needs the Pro plan" response (a 403 for API routes), and show a friendly message with a link to my upgrade page. Never show a raw error.
5. Keep the screen checks too, so free users see what's locked, but treat them as display only.
6. Fix the gaps one feature at a time, and after each one tell me how to test it with a free test user and a paid test user (subscribed through my Stripe sandbox).
List every file you plan to change and wait for my "go".
Tips to customize: If someone loses access (a downgrade or a cancellation), decide what happens to their extra data. Locking it as read-only is usually kinder than deleting it. Ask: "When a user drops to Free with more projects than Free allows, keep everything, but block new ones until they're under the limit." Never let the AI delete user data as part of a downgrade.
Section 4: Upgrades, Cancellations, Trials and Failed Payments
4.1 Add a "Manage Billing" Button With Stripe's Customer Portal
Untested: not yet run against a model.
Use this when customers have to email you to upgrade, downgrade, update their card or cancel. You get a button that opens Stripe's hosted customer portal, so they can do it themselves.
Fill in: [TECH STACK], [MY PLANS AND PRICE IDS] (e.g. "Pro monthly and Pro yearly, IDs in my env file"), [WHEN CANCELLING SHOULD TAKE EFFECT] (e.g. "at the end of the paid period" or "help me choose"), [WHERE THE BUTTON GOES] (e.g. "the account settings page").
Look first and explain before changing anything. Add a "Manage billing" button that sends logged-in customers to Stripe's customer portal. Set it up in my Stripe sandbox (test mode) first.
Tech stack: [TECH STACK]
My plans and price IDs: [MY PLANS AND PRICE IDS]
When cancelling should take effect: [WHEN CANCELLING SHOULD TAKE EFFECT]
Where the button goes: [WHERE THE BUTTON GOES]
Please:
1. Walk me through the customer portal settings in my Stripe Dashboard (sandbox first), step by step: turn on switching plans and pick the products customers can switch between, choose whether to prorate plan changes, choose whether downgrades happen right away or at the end of the period, and set cancellations to match what I chose above. Point me to the right page on docs.stripe.com instead of guessing menu names.
2. Create a server route that checks the user is logged in, looks up THEIR Stripe customer ID from my database, creates a portal session with a return_url back to my app, and redirects them to the session's URL. Never accept a customer ID from the browser.
3. Add the button where I said.
4. Don't change access when the customer clicks the button or comes back from the portal. Access changes when my webhook handler (Prompt 2.1) receives the subscription update.
5. When the subscription is set to cancel at the end of the period, show a line like "Your Pro plan ends on March 3" in my app, using the real end date, so the customer knows they still have access until then.
6. Remind me that the portal has separate settings for my sandbox and live mode, so I'll need to set it up again before going live.
Tips to customize: Portal links are short-lived, so create a new session each time someone clicks the button. Don't save or email the link. Stripe's docs list a few cases where customers can cancel in the portal but can't switch plans, such as subscriptions with more than one product or usage-based prices. If switching plans doesn't show up, check the portal limitations on docs.stripe.com. If you offer trials, Stripe's docs say a plan change in the portal ends the free trial by default, unless you set the portal to keep the trial going.
4.2 Free Trials and Failed Payments Without Surprises
Untested: not yet run against a model.
Use this when you're adding a free trial, or a renewal payment fails and you're not sure when (or whether) your app should lock that person out. You get your Stripe settings and your app's rules lined up, plus clear messages for the customer.
Fill in: [TECH STACK], [MY TRIAL] (e.g. "14 days, card required up front", "7 days, no card" or "no trial"), [MY GRACE PERIOD] (the same one you used in Prompt 2.2), [HOW I CONTACT CUSTOMERS] (e.g. "a banner in the app and Stripe's emails").
Don't change anything until I say "go". Help me plan free trials and failed renewal payments so my Stripe settings and my app agree. Use my Stripe sandbox (test mode) for everything.
Tech stack: [TECH STACK]
My trial: [MY TRIAL]
My grace period: [MY GRACE PERIOD]
How I contact customers: [HOW I CONTACT CUSTOMERS]
Trials:
1. Check Stripe's current trial docs and tell me which way of adding a trial fits my setup (Stripe has more than one). Don't guess parameter names.
2. During a trial the status is "trialing", and my app gives paid access (Prompt 2.2).
3. Use the customer.subscription.trial_will_end event (Stripe sends it 3 days before a trial ends, by default) to remind the customer, unless Stripe's own emails already do this for me.
4. If my trial doesn't collect a card, explain what Stripe can do when the trial ends without one (create an invoice, cancel, or pause) and help me choose.
Failed renewal payments:
5. Explain in plain English what happens in Stripe when a renewal fails: the subscription becomes past_due, Stripe retries the payment on the schedule in my Dashboard settings (Smart Retries or my own rules), and after the last retry it does what I chose there: cancel the subscription, mark it unpaid, leave it past_due, or pause it. Show me where those settings are, and don't guess the default numbers.
6. Make sure my grace period isn't longer than Stripe's retry window, so a user doesn't keep paid access after Stripe has given up.
7. On invoice.payment_failed, show the customer a friendly banner with a link to update their card in the customer portal (Prompt 4.1). Clear the banner when invoice.paid arrives.
8. Never lock someone out the moment one payment fails unless that's my choice, and make sure access does end once the grace period is over and it's still unpaid.
Tips to customize: Stripe can send its own emails for failed payments, trials that are ending and upcoming renewals. Check your Dashboard email settings before your app sends a second copy. If a customer's very first payment fails, the subscription is incomplete, not past_due, and Stripe's docs say Smart Retries don't retry that first payment. Your app needs to ask the customer to pay again.
4.3 Test Every Plan Change Before Real Customers Do
Untested: not yet run against a model.
Fill in: [TECH STACK], [MY PLANS] (e.g. "Free, Pro monthly, Pro yearly"), [MY TRIAL] (e.g. "14 days" or "no trial"), [MY GRACE PERIOD].
Help me test my subscriptions end to end in my Stripe sandbox (test mode). Nothing here should touch live mode or real customers. Don't ask me to paste any keys.
Tech stack: [TECH STACK]
My plans: [MY PLANS]
My trial: [MY TRIAL]
My grace period: [MY GRACE PERIOD]
Please:
1. Show me how to run my webhook locally with "stripe listen --forward-to ..." so I can watch events arrive while I test.
2. Explain how to use Stripe's test clocks (called simulations in the Dashboard) to move a test subscription forward in time, so I can see renewals, trial endings and retries without waiting.
3. Give me a checklist where each test says what to do, which events should arrive, and what my subscriptions table and my app should show afterwards:
- New subscription with the success test card (4242 4242 4242 4242)
- Upgrade, then downgrade, in the customer portal
- Cancel at the end of the period: still has access before the date, loses it after
- Trial start, the trial_will_end reminder, then the trial ending with a successful payment
- Renewal that fails (use Stripe's "decline after attaching" test card, 4000 0000 0000 0341), the grace period, and then what happens after Stripe's last retry
- The same webhook event sent twice
4. For each test, check the paywall from Section 3 too: log in as that test user and try a paid action.
5. Give me a short table of what passed and what failed, and fix the failures one at a time after I say "go".
Tips to customize: Use Stripe's own test cards from docs.stripe.com/testing and the Billing testing page instead of making up numbers. Stripe's docs say stripe trigger sends events with made-up test data, so it's good for checking one handler but not a whole subscription's life. Use real sandbox subscriptions for that. When everything passes, follow Get Paid's Prompt 4.2 to switch to live keys, and set up the customer portal and webhook again in live mode.
Get new free packs in your inbox
Optional. Every prompt here is free, and you don't need to sign up to use any of them. We email when we add new free packs. Unsubscribe anytime.
Thanks, you're on the list. Watch your inbox for the next prompt drop.