// From Lovable, Bolt or Replit to production
How do you add Stripe payments to a Lovable app?
Lovable offers two paths: built-in payments, where Lovable sets up Paddle or Stripe for you (paid plan required), or your own Stripe account connected with a restricted key. The own-account setup checks subscription status with Stripe at sign-in and has webhooks off by default. For production, add a verified webhook that writes each user's access to your database.
Want it done for you? Vibe-code to Production: from €1,500, fixed quote in 24h →

By Gabriel Cazaciuc, Founder & lead developer, Netcraft Digital
Last updated
Key facts
- Own Stripe account in Lovable
- Webhooks off by default; status checked with Stripe at sign-in
- Source: Lovable docs, Nov 2026
- Subscription matching
- Subscriptions are matched to users by email address
- Source: Lovable docs, Nov 2026
- Built-in payments via Paddle
- 5.0% + 50¢ per transaction, Paddle is merchant of record
- Source: Lovable docs, Nov 2026
- Stripe webhook delivery
- Retried for up to 3 days in live mode; no order guarantee
- Source: Stripe docs, Nov 2026
- Stripe setup with us
- Included in the Production tier, from €3,000
- Source: Our fixed-price offer, Nov 2026
Which Stripe option should I choose in Lovable?
Choose built-in payments if you want Lovable to handle the provider account and taxes; choose your own Stripe account if you want the customer and payment data in an account you control and plan to move the app off Lovable later. A project can use one or the other, not both.
| Built-in payments | Your own Stripe account | |
|---|---|---|
| Who creates the provider account | Lovable (Paddle or Stripe) | You |
| Lovable plan | Paid plan required | Works on the Free plan |
| Keys | None to handle | Restricted key (rk_…) stored as STRIPE_SECRET_KEY |
| Fees | Paddle 5.0% + 50¢; Stripe at standard rates; no Lovable fee | Standard Stripe rates |
| Tax handling | Paddle is merchant of record; Stripe Managed Payments on by default where eligible | Yours to set up (Stripe Tax or your accountant) |
| Test environment | Separate test and live environments | The preview has no separate test environment |
| Switching provider later | Existing subscriptions do not migrate | Already in your account |
The last row is the one to think about early. If you start on built-in payments with Paddle and later want your own Stripe account, existing subscribers do not move with you; they have to subscribe again.
Is Lovable's default Stripe setup enough for production?
It works for a first version, with limits you should know. Without webhooks, the app asks Stripe whether the user has an active subscription when they sign in and use the app, and it matches the subscription to the user by email address.
- Email mismatch: if a user pays with a different email in Checkout, or changes their email in your app, the subscription is not found and a paying customer loses access.
- No record in your database: you cannot list paying users, build an admin view or send a “payment failed” email without asking Stripe each time.
- Events between sign-ins are missed: a refund, a dispute or a failed renewal changes nothing in the app until the next check.
- Preview with a live key is real money: Lovable's docs warn that payments made from the preview with a live key are real charges.
What does a production Stripe setup look like?
The browser starts Checkout, Stripe sends a webhook to your server, and your server writes the result to a table the user can read but not change. Access in the app comes only from that table.
Stripe webhook checklist
- Store stripe_customer_id on the user when the first Checkout session is created, and match by that ID instead of email
- Pass the user's ID as client_reference_id or metadata on the Checkout session
- Verify the Stripe-Signature header against the raw request body with the endpoint's whsec_ secret
- Save each processed event ID and skip IDs you have already seen
- Handle checkout.session.completed, customer.subscription.updated, customer.subscription.deleted and invoice.payment_failed
- Do not depend on event order; when in doubt, fetch the subscription from Stripe and store its current state
- Return a 2xx response quickly and do slow work after
- Give users select-only access to the subscriptions table; only the webhook writes to it
In a Supabase edge function (Deno), the signature check needs the raw text body and the async crypto provider:
const body = await req.text(); // raw body, not req.json()
const signature = req.headers.get("Stripe-Signature")!;
const event = await stripe.webhooks.constructEventAsync(
body,
signature,
Deno.env.get("STRIPE_WEBHOOK_SECRET")!,
undefined,
Stripe.createSubtleCryptoProvider(),
);And the table the app reads access from, writable only by the webhook (which uses the secret key):
create table public.subscriptions (
user_id uuid primary key references auth.users(id),
stripe_customer_id text unique not null,
stripe_subscription_id text unique,
status text not null,
current_period_end timestamptz
);
alter table public.subscriptions enable row level security;
create policy "read own subscription" on public.subscriptions
for select to authenticated
using ((select auth.uid()) = user_id);
-- no insert/update/delete policies: users cannot write hereThe common mistake we look for is a plan or is_paid column on the user's own profile row, which the profile policy lets the user update. More on that in the Lovable + Supabase security checklist.
Why do Stripe webhooks need duplicate protection?
Because Stripe may deliver the same event more than once, retries failed deliveries for up to three days in live mode, and does not guarantee order. A handler that grants credits or sends an invoice on every delivery will sometimes do it twice.
What should happen when a renewal fails or a user cancels?
Access should follow the subscription status Stripe sends, not the date of the last payment. Decide the rules before launch, then make the webhook apply them.
| Event | What the app should do |
|---|---|
| invoice.payment_failed | Keep access during Stripe's retry period, show a banner, and email the user a link to update the card |
| customer.subscription.updated with status past_due or unpaid | Limit access to read-only or the free plan, as your terms say |
| customer.subscription.updated with cancel_at_period_end | Keep access until current_period_end, then downgrade |
| customer.subscription.deleted | Remove paid access and keep the user's data |
| charge.refunded or charge.dispute.created | Flag the account for review; decide case by case |
Without these rules, the usual outcome is one of two mistakes: paying users locked out after a card update, or cancelled users keeping access for months. If you want this built and tested in your repo, a Lovable developer can do it in a few days.
How do I test Stripe in a Lovable app?
Use a test key (rk_test_… or sk_test_…) and the card 4242 4242 4242 4242 with any future date and any CVC. Stripe integration works in the deployed version, not in the preview, and the customer portal does not open inside the preview panel. For webhooks, the Stripe CLI can forward events to a local function (stripe listen --forward-to) and send test events (stripe trigger).
Test before switching to live keys
- Successful payment grants access, once
- Opening the success URL without paying grants nothing
- A cancelled subscription removes access at the end of the period
- A failed renewal (card 4000 0000 0000 0341) is recorded and the user is told
- A refund or dispute is reflected in your table
- Re-sending the same event from the Stripe dashboard changes nothing
Plans, trials and coupons are covered in Stripe subscriptions for an MVP. Payments are one of five areas on the production checklist for AI-built apps, and the full prices are on our pricing page.