Stripe Subscriptions in an MVP: Webhooks, Trials and the Edge Cases That Bite
Add Stripe subscriptions to an MVP safely: verify webhooks, process each event once, grant access on paid invoices, and plan for trials and failed cards.
7 min read

Contents
To add Stripe subscriptions to an MVP, let Stripe own billing and let webhooks tell your app what happened. Verify every webhook's signature, process each event only once, grant access when an invoice is paid, and decide in advance what happens when a trial ends without a card or a renewal payment fails.
Picture a founder who wires up Stripe Checkout on a Friday. The success page sets a "pro" flag on the user, and it works in testing. Over the next month, a customer whose card was declined at renewal keeps full access, another who cancelled in the billing portal is still marked pro, and a third is charged twice after a double-click on the upgrade button. None of these show up in a demo. All of them show up with real customers.
What does Stripe handle, and what does your app have to handle?
Stripe handles the money: it stores payment methods, creates invoices, charges cards, retries failed payments and emails receipts. Your app handles access: it has to know at any moment which plan each customer is on and whether they should be let in.
The link between the two is a webhook. A webhook is an HTTP request that Stripe sends to an endpoint on your server when something changes, such as a paid invoice or a cancelled subscription. The success page after Checkout is not enough on its own, because the customer may close the tab before it loads, and because most subscription changes after sign-up happen without the customer visiting your app at all.
A sound setup keeps one record per customer in your database: the Stripe customer ID, the subscription ID, the current plan and the subscription status. Webhooks update that record; your app reads it to decide access.
Which Stripe webhook events does a subscription MVP need?
Most subscription MVPs need six events: invoice.paid, invoice.payment_failed, invoice.payment_action_required, customer.subscription.updated, customer.subscription.deleted and customer.subscription.trial_will_end. If you use Checkout, add checkout.session.completed to link the new subscription to your user.
Stripe's subscription webhooks guide describes what each one means:
invoice.paid. Sent when an invoice is paid. Stripe says you can grant access when you receive it and the subscription's status is active.
invoice.payment_failed. A payment for an invoice failed. Tell the customer and ask them to update their card.
invoice.payment_action_required. The payment needs the customer to authenticate, for example with their bank's confirmation step.
customer.subscription.updated. Sent when a subscription starts or changes: a plan switch, a cancellation scheduled for the end of the period, a status change.
customer.subscription.deleted. Sent when the subscription ends. Remove access.
customer.subscription.trial_will_end. Sent three days before a trial ends by default, or straight away if the trial is shorter than three days.
Read the subscription's status from the event, not from what you expect to happen next. A plan change from the customer portal and a status change from a failed payment arrive through the same updated event.
How do you make a Stripe webhook handler safe?
Verify the signature, return a success response quickly, and record each event ID so a repeat delivery does nothing. Those three habits rule out the most common webhook bugs: forged requests, double processing and stale state.

Stripe's webhooks documentation sets out the behaviour you have to design for:
What Stripe guarantees, and what it doesn't
Signatures. Each request carries a Stripe-Signature header. Your handler checks it against your endpoint's signing secret, using the raw request body. Frameworks that parse JSON before your code runs will break the check, so read the raw body on this route.
Duplicates. Endpoints sometimes receive the same event more than once. Stripe recommends logging the event IDs you have processed and skipping any you have seen.
Order. Stripe does not guarantee that events arrive in the order they were created. An updated event can land before the created one.
Retries. If your endpoint doesn't respond with success, Stripe retries with exponential backoff for up to three days in live mode.
Timeouts. Return a 2xx status quickly, before any slow work. Put heavy work, such as provisioning or emails, on a queue.
To handle ordering, don't trust the event payload as the latest state. When an event arrives, fetch the current subscription from Stripe's API and save that. The same idea, making repeat actions harmless, comes up in our post on testing AI agents before production.
Outgoing calls need protection too. Stripe's idempotency documentation says idempotency keys allow "safely retrying requests without accidentally performing the same operation twice," and that "all POST requests accept idempotency keys." Send one key per user action, for example per upgrade click, and the double charge in the opening example can't happen.
How should free trials work in Stripe?
Decide first whether a trial needs a card. With a card on file, the subscription simply starts charging when the trial ends. Without one, you choose what Stripe does at the end of the trial, and your app has to handle the result.

Stripe's trials guide lists three options for a trial that ends with no payment method, set in trial_settings.end_behavior.missing_payment_method:
create_invoice (the default). Stripe creates an invoice; if it can't be paid, the subscription moves to past_due.
cancel. The subscription is cancelled.
pause. The subscription is paused until you resume it, and its status becomes paused.
For most MVPs, pause is the easiest to reason about: the customer keeps their data, loses access, and comes back by adding a card. Whatever you pick, use the trial_will_end event to remind the customer before the trial ends. Stripe can also send its own reminder emails, which the guide says go out seven days before the trial ends.
What happens when a renewal payment fails?
The subscription usually moves to past_due, Stripe retries the payment on a schedule, and your app decides how much access a past_due customer keeps. Only when the retries run out does the subscription end up cancelled or unpaid, depending on your settings.
Stripe's subscription overview defines the statuses your code must expect:
trialing: in a trial.
active: in good standing.
incomplete: the first payment needs to succeed within 23 hours to activate the subscription.
incomplete_expired: that first payment never succeeded within the 23 hours.
past_due: the latest invoice's payment failed or wasn't attempted. Stripe may retry, but the status doesn't guarantee another attempt.
unpaid: set only if your dashboard settings say so; Stripe advises removing access, because retries have already happened.
canceled: final; it can't be updated.
paused: a trial ended without a payment method and the setting above was pause.
For retries, Stripe's Smart Retries page says that on new accounts Smart Retries is on by default, with up to eight attempts within two weeks; the window can be set from one week to two months. A common MVP policy is to keep access during past_due, show a banner asking for a new card, and remove access on canceled or unpaid.
Should you build your own billing screens?
Not at first. Stripe's hosted customer portal lets customers update payment methods, switch or cancel plans, pause subscriptions and download invoices, and every change it makes reaches your app through the same webhooks.
The customer portal documentation notes limits worth knowing before you rely on it: when plan switching is on you can offer up to 10 products, and subscriptions with trials, several products or usage-based billing can be cancelled in the portal but not updated there. If your pricing fits inside those limits, the portal saves weeks of work.
A launch checklist
Webhook endpoint uses the raw body and verifies the signature.
Processed event IDs are stored, and repeats are skipped.
The handler refetches the subscription before saving its state.
Access is decided by the stored status, not by a flag set on the success page.
Every create or update call to Stripe carries an idempotency key.
Trial end, failed payment and cancellation have each been run end to end in test mode.
Test mode and live mode use separate keys and separate endpoint secrets.
Many AI-built apps that break with real users fail on exactly these items, and so do no-code apps moved to code, covered in our guide to migrating off Bubble.
How we approach it at Vizio AI
We treat billing as a state machine, not a checkout button. Before writing code we list every status a subscription can be in, what the customer can do in each, and which event moves them from one to the next; that list becomes the test plan.
Then we build the smallest version that's safe: Checkout and the customer portal from Stripe, one webhook endpoint with signature checks and event logging, and an access check that reads the stored status. When we take over an app that already charges customers, we start by replaying its webhook history against that list. If your product is stuck at this stage, see Finish Your Build; new products start in our Venture Studio.
Sources
Stripe Docs, Using webhooks with subscriptions: https://docs.stripe.com/billing/subscriptions/webhooks
Stripe Docs, Receive Stripe events in your webhook endpoint: https://docs.stripe.com/webhooks
Stripe Docs, How subscriptions work: https://docs.stripe.com/billing/subscriptions/overview
Stripe Docs, Use trial periods on subscriptions: https://docs.stripe.com/billing/subscriptions/trials
Stripe Docs, Smart Retries: https://docs.stripe.com/billing/revenue-recovery/smart-retries
Stripe Docs, Customer portal: https://docs.stripe.com/customer-management
Stripe API Reference, Idempotent requests: https://docs.stripe.com/api/idempotent_requests
Vizio AI, Your AI-Built App Works in the Demo. Here's What Breaks With Real Users: https://www.vizio.ai/resources/blog/ai-built-app-what-breaks-with-real-users
Vizio AI, Before You Put an AI Agent in Front of a Client: The Checks We Run: https://www.vizio.ai/resources/blog/ai-agent-testing-production
Vizio AI, Moving Off Bubble: When and How to Migrate a No-Code MVP to Code: https://www.vizio.ai/resources/blog/bubble-to-code-migration
Vizio AI, Finish Your Build: https://www.vizio.ai/finish-your-build
Vizio AI, Venture Studio: https://www.vizio.ai/studios/venture-studio
FAQs.
Read More

Your AI-Built App Works in the Demo. Here's What Breaks With Real Users

Before You Put an AI Agent in Front of a Client: The Checks We Run

Moving Off Bubble: When and How to Migrate a No-Code MVP to Code

Supabase After 30 October: Table Grants, RLS and the Launch Check

Why Projects Built With Claude or Codex Stall Before Launch

From AI Prototype to App Store: Shipping a Mobile MVP That Passes Review

Claude Code for Operations Teams: Automating Internal Tools Without a Dev Team

Reading Invoices, Contracts and Forms With AI: Document Processing Without Retyping



