Two ways to take payments in a Lovable app
Lovable offers two routes, and a project uses one of them, not both. Built-in payments is the one Lovable recommends for most projects. You ask in chat for a pricing page or a subscription, choose a provider (Stripe or Paddle) and Lovable creates and manages the provider account, the API keys, the webhook endpoints and separate test and live environments. Products, prices, trials and discount codes are created through chat, and a Payments tab in the editor shows transactions, refunds and a go-live checklist. It needs a paid Lovable plan, a backend (Lovable Cloud, or your own Supabase project for apps created with the newer TanStack Start stack), and only workspace or project admins and owners can set it up. Lovable's documentation says the fees are the same as setting up Stripe directly; payouts are configured in the Stripe dashboard once you have claimed the account.
Connecting your own Stripe account is the other route. You create a restricted API key in your Stripe dashboard, paste it into Lovable's Connect Stripe form, and Lovable writes backend functions that call Stripe with that key, creates products and prices in your account after you approve them, and adds the checkout to the app. Payments land in your Stripe account; you handle verification, payouts, taxes and disputes there. This route works on the Free plan and on older React and Vite projects that use your own Supabase, which built-in payments does not support.
Switching later is possible but not free: products, prices and subscriptions do not move between the two, and disconnecting a provider does not cancel existing subscriptions or refund anyone. Decide before the first real customer pays.
When Lovable's built-in payments are enough
Built-in payments suit the common case: a software product or a digital good, one subscription or a one-time purchase per user, sold through a hosted checkout. Lovable handles the parts that are easy to get wrong by hand. It registers the webhook endpoints that deliver payment events to the app and manages the signing secret, it keeps test and live products apart and syncs prices from test to live when you publish, and it gives you a customer portal where people manage their subscription.
The trade-off is that you work inside Lovable's rules. Products are managed through chat rather than the Stripe dashboard. By default a user can have one active subscription per environment. A project with payments enabled cannot be remixed. Stripe Checkout is embedded and styled from the Stripe dashboard, not from your app's design. Physical goods are pointed at the Shopify integration instead. And Lovable warns that deleting the app's registered webhook endpoint quietly stops payment events: purchases still succeed, but subscriptions never activate. Built-in payments are the right choice if:
- You do not already have a Stripe account with customers, subscriptions and tax settings you need to keep.
- One plan per user, with optional trials and discount codes, covers your pricing.
- You sell software or digital products and can pass Stripe's go-live check: a privacy policy, terms, a refund policy and real content on the site.
- You want Lovable to manage keys, webhooks and the test and live split, and you are on a paid plan.
When you need your own Stripe account and webhooks
Your own Stripe account is the better route when the account itself matters: you already bill customers through it, your accountant and tax setup depend on it, or you plan to move hosting away from Lovable and want every provider under your company from day one. It is also the route for pricing that built-in payments does not model, such as usage-based billing, several subscriptions per customer, team plans where one payer buys seats for other users, invoices for business customers or payouts to other people through Stripe Connect. Lovable's documentation says custom payment integrations beyond its two routes are not officially supported, so expect to write and own that code.
With your own account, Lovable's default setup uses no webhooks. The app asks Stripe directly whether the signed-in user has an active subscription, and it matches the user to a Stripe customer by email address. That is fine for a first version with a handful of customers. It stops being fine when a customer signs in with a different address from the one they paid with, when access must end promptly after a failed renewal or a refund, when you fulfil orders or send receipts, or when your database needs to know who has paid so that policies and server functions can check it.
In those cases you need a webhook endpoint of your own. Lovable can write the function; you register the endpoint in the Stripe dashboard, choose the events it receives and store the signing secret as a backend secret. The function verifies the signature on every delivery, records the event and updates the customer's access in your database. The events worth handling first:
- checkout.session.completed: a purchase or a new subscription finished, so access can be granted.
- customer.subscription.updated and customer.subscription.deleted: plan changes, cancellations and the end of a trial.
- invoice.payment_failed and invoice.paid: a renewal failed or recovered.
- charge.refunded and charge.dispute.created: money went back, so what the customer can do should change.
Grant access from Stripe's records, not from the success page
The most common payment flaw in AI-built apps is granting access when the customer lands on the success page. People close the tab before it loads, and the success page is a normal address that anyone can open directly. Access should change only because Stripe said so: a verified webhook event, or a server-side call to Stripe that checks the subscription. The page the customer sees after paying is a confirmation, not the source of truth.
Keep the answer to "who has paid" in one place: a table of entitlements with the user, the Stripe customer and subscription IDs, the status and the end of the current period. Only server-side code writes to it, and the row-level security policy lets a user read their own row and nothing else. The frontend reads that table to decide what to show, and the server functions that do paid work, such as a function that calls an AI model, check it again before doing anything, because a hidden button is not a permission check.
Two more rules save support tickets. Stripe can deliver the same event more than once, so store the event ID and ignore a repeat, or a retried webhook can grant two credit top-ups for one payment. And do not revoke access the moment a customer cancels: they have paid until the end of the period, and Lovable's own documentation says to keep access until then. A subscription in the past_due state should prompt the customer to update their card rather than lock them out at once.
Keep the Stripe key where it belongs
With built-in payments, Lovable holds the keys and the webhook signing secret, and the app code never sees them. With your own account, the key is stored as a backend secret named STRIPE_SECRET_KEY, in the Lovable Cloud secrets or synced to your Supabase edge function secrets, and the backend functions use it from there. Nothing with that key should ever appear in frontend code, in the repository or in a chat message. Create a restricted key with only the permissions the checkout needs rather than a full secret key, and if a key was ever pasted into a prompt or committed to GitHub, rotate it in the Stripe dashboard; deleting the line does not undo the copies.
One detail catches people who connect their own Supabase: disconnecting Stripe inside Lovable does not delete STRIPE_SECRET_KEY from Supabase, so the deployed functions can keep charging customers until you remove the secret there yourself. The webhook signing secret follows the same rules as the API key.
Test mode, live mode and going live
Built-in payments keep the two modes apart for you. The preview uses Stripe's test mode and test cards: 4242 4242 4242 4242 succeeds, 4000 0000 0000 3220 asks for extra authentication and 4000 0000 0000 0002 is declined. The published app uses live mode once you have completed Stripe's go-live steps, and products and prices sync from test to live when you publish. Discount codes do not sync, so recreate them.
With your own account, the key decides the mode and there is no separate environment: a test key keeps everything in test mode, and with a live key a payment made from the preview is a real charge. Price IDs differ between the modes, so going live means switching the key and the price IDs together, then making one real purchase and refunding it. Connect your custom domain before going live, because the webhook address and the customer portal return address change with the domain; our guide on taking a Lovable app to production covers that switch.
Whichever route you use, walk through the whole lifecycle with test cards before launch, not just a successful purchase:
- A purchase, then a cancellation, then the end of the paid period.
- A renewal, and a failed renewal followed by a recovered payment.
- A trial that ends with and without a card on file.
- A refund and a dispute, and what the customer can still do afterwards.
- A card that needs extra authentication, and a customer who closes the tab before the success page.
What to check before real customers pay
If the payments in your app were set up in an afternoon, a short review before launch is worth more than any single fix. The questions below are the ones we ask first when we review a Lovable app's payments. A list like this finds the common mistakes; it does not prove the payment flow is correct, and anything it misses is still your responsibility.
- Where does access get granted: from a webhook or a server-side check against Stripe, or from the success page?
- Can a signed-in user who never paid reach a paid screen, call a paid function or change their own entitlement row?
- Does the webhook function verify Stripe's signature, and what happens if the same event arrives twice?
- Is the Stripe key a restricted key stored as a backend secret, absent from the frontend bundle and the repository history?
- What changes for the customer on a failed renewal, a cancellation, a refund and a dispute?
- Is there a log of payment events you can read when a customer says they paid and cannot get in?
Frequently asked questions
Does Lovable integrate with Stripe?
Yes, in two ways. Built-in payments, on a paid Lovable plan, creates and manages a Stripe or Paddle account for the project, including keys, webhooks and test and live environments. Connecting your own Stripe account uses a restricted API key from your dashboard and backend functions that Lovable writes. A project uses one or the other.
Do I need webhooks for Stripe in a Lovable app?
With built-in payments, Lovable registers them for you; do not delete them. With your own Stripe account, the default has none and the app asks Stripe whether a user has a subscription. You need a webhook once access must change on failed renewals and refunds, orders need fulfilling, or your database has to know who has paid.
Can I use my existing Stripe account with Lovable?
Yes, through the Connect your own Stripe account option: you paste a restricted key and payments go to your account. Built-in payments always creates a new Lovable-managed account instead, and products and subscriptions are not migrated between the two.
How much does it cost to fix payments in a Lovable app?
With us, payment and access fixes are part of taking a prototype to production: usually $4,500–12,000 over two to five weeks, depending on what else needs work. If you are not sure what is wrong, a $1,500 launch check comes first, reviews sign-in, data access, secrets and payments, and is credited against fixes ordered within 30 days.
Not sure your app is ready for real users?
Our launch check reviews sign-in, data access rules, secrets, payments, backups and deployment, using only the access you give us. In 3 business days you get a written report with each issue ranked by risk and a fixed price for the fixes. $1,500, credited against fixes ordered within 30 days.
If you already know what needs fixing, book a call and get a fixed quote for the fix instead.