Before you start
- A Stripe account. Create one at stripe.com if you don’t have one. You manage the account yourself: business verification, payouts, taxes, and disputes all happen in Stripe, at Stripe’s standard rates.
- A backend. The integration works with the built-in backend (Cloud), which is enabled by default, and with your own Supabase project.
- Login for subscriptions. One-time payments work without user accounts, but subscriptions require authentication in your app so Lovable can match subscriptions to your users.
- The Stripe connector enabled for your workspace. Your workspace has a single Stripe connector setting, and it controls both built-in payments and this integration. It is enabled by default, except on Enterprise plans where it is disabled by default. On Business and Enterprise plans, a workspace admin or owner can enable it in Connectors → Admin settings → App + chat connectors.
Connect your Stripe account
The whole setup happens in chat. Have your Stripe account ready, then follow these steps:Ask for payments in chat
Submit your Stripe API key
rk_...) or a secret key (sk_...), in test or live mode. Start with a test key so you can try everything safely. Publishable keys (pk_...) don’t work here.Review what Lovable builds
How payments work
Lovable builds your payment flow with edge functions: small pieces of backend code that call Stripe using your stored key, so the key is never exposed in your app.One-time payments
For a one-time purchase, Lovable creates a checkout function and a buy button. When a buyer clicks the button, Stripe Checkout opens in a new tab. After paying, the buyer returns to a payment success page in your app, or to a cancellation page if they cancel. Buyers don’t need an account in your app: if no one is signed in, Stripe collects the buyer’s email at checkout.Subscriptions
For subscriptions, Lovable builds checkout for your plans and a subscription check that runs when users sign in and use your app. Your app asks Stripe directly whether the user has an active subscription, so paid features unlock and lock automatically.Products and prices
Lovable can create products and prices directly in your Stripe account, asking for your approval in chat before each one. It can also reuse products and prices that already exist in your account. Everything it creates is visible in your Stripe dashboard, as if you had created it there.Webhooks
By default, the integration does not use webhooks: your app checks payment and subscription status directly with Stripe. This keeps the setup simple and is enough for most apps. Webhooks are messages Stripe sends to your backend as soon as an event occurs, such as a payment succeeding. If you need them (for example, to trigger order fulfillment), ask Lovable to set them up. Lovable writes the webhook function, and you finish the setup in your Stripe dashboard:Create an event destination
Select events
payment_intent.succeeded or customer.subscription.updated.Store the signing secret
Test and go live
The key you provide determines the mode: a test key (rk_test_... or sk_test_...) keeps everything in Stripe’s test mode, where the card number 4242 4242 4242 4242 with any future expiration date and any 3-digit security code (CVC) completes a payment without charging real money.
You can test the full flow directly in the preview. Checkout opens in a new tab. Unlike built-in payments, the preview has no separate test environment: your project uses one key at a time, so with a live key, payments made from the preview are real.
To go live:
Switch to a live key
Switch to live products and prices
Verify with a real purchase
Manage the integration
See your payments
Open Payments from the project’s More menu. This is the same view that built-in payments uses. On a project using your own Stripe account, it shows a Self-managed Stripe badge and a read-only view of your payments data, including transactions, refunds, and products. Use the Open in Stripe button to manage products, issue refunds, and change settings in your Stripe dashboard.Update your Stripe key
Ask Lovable to update your Stripe key at any time, for example after rotating it in Stripe or when switching from test to live. The Update Stripe secret key form works the same way as the Connect Stripe form. If your stored key stops working (for example, you revoked it in Stripe), Lovable pauses Stripe actions and asks you to submit a new key.Where your key is stored
The key is stored as a backend secret namedSTRIPE_SECRET_KEY. Lovable never shows the value again and it never appears in your app’s code or repository.
- On a Cloud project, it appears in the Cloud view’s Secrets section with a Lovable badge. Update it through chat, not from the Secrets view.
- On a project using your own Supabase, it is synced to your Supabase project’s edge function secrets, which you can see in the Supabase dashboard.
Disconnect Stripe
Anyone with edit access to the project can disconnect, the same as for connecting. This differs from built-in payments, where disconnecting is limited to admins, owners, and the person who set payments up.Open the Payments view
Disconnect
- On a Cloud project, payment features stop working until you reconnect or remove the payment code.
- On a project using your own Supabase, Lovable does not remove
STRIPE_SECRET_KEYfrom your Supabase project’s edge function secrets. The deployed payment functions keep working, and keep charging customers, as long as that secret exists. To stop payments, deleteSTRIPE_SECRET_KEYin the Supabase dashboard or remove the payment code.
Limitations
- A project can’t use your own Stripe account and built-in payments at the same time. Disconnect one before enabling the other.
- The Payments view is read-only for this integration. You create products, issue refunds, and configure webhooks in your Stripe dashboard.
Troubleshooting
Stripe rejected the key
Stripe rejected the key
Lovable asks me to update my Stripe key
Lovable asks me to update my Stripe key
Lovable won't offer to connect my own Stripe account
Lovable won't offer to connect my own Stripe account
The customer portal shows an error
The customer portal shows an error
Checkout doesn't open
Checkout doesn't open
Checkout fails with an error
Checkout fails with an error
- On a Cloud project, open the Cloud view and check the function logs.
- On a project using your own Supabase, open the Supabase dashboard and check the logs under Edge Functions.
FAQ
Do payments work in the preview?
Do payments work in the preview?
Can Lovable use products and prices that already exist in my Stripe account?
Can Lovable use products and prices that already exist in my Stripe account?
Can anyone see my Stripe key after I submit it?
Can anyone see my Stripe key after I submit it?
Who bills me for payment processing?
Who bills me for payment processing?
Does disconnecting cancel my customers' subscriptions?
Does disconnecting cancel my customers' subscriptions?
Why does the Stripe connector in my workspace settings describe built-in payments?
Why does the Stripe connector in my workspace settings describe built-in payments?
Can I switch to built-in payments later?
Can I switch to built-in payments later?