Stripe Connect lets you build marketplace and platform apps where money flows between multiple parties — your platform takes a fee while connected sellers or service providers receive payouts. In Lovable, Stripe is a native shared connector: describe your marketplace payment flow in chat, and Lovable generates the Edge Functions, database tables, and UI automatically. Setup takes about 20 minutes.
Build marketplace payments without writing Stripe Connect from scratch
Standard Stripe is for collecting payments — a customer pays you, and funds land in your account. Stripe Connect is different: it handles payments where money needs to flow to someone else. Think of a freelance marketplace where the platform takes 10% and the freelancer receives 90%, a rental platform routing payments to property owners, or a services app paying independent contractors. Stripe Connect handles the legal, banking, and compliance complexity that would otherwise take months to build.
Lovable treats Stripe as a native shared connector, meaning the AI already understands Stripe's API surface, authentication patterns, and best practices. When you describe your marketplace flow — 'charge customers, take a 15% platform fee, and pay sellers on a weekly schedule' — Lovable generates the correct Edge Functions using Stripe's server-side SDK, wires them to your frontend, and sets up the database tables needed to track transactions and connected account status. You get production-quality payment infrastructure through chat prompts rather than weeks of SDK documentation reading.
Important context before starting: Stripe Connect integration only works in deployed mode (your live Lovable Cloud URL), not in the in-editor preview. This is because Stripe's webhook delivery and OAuth flows require real HTTPS endpoints. Test with Stripe's test mode keys first — Stripe provides test card numbers and a test mode dashboard that mirrors production behavior without real money moving. Once everything works in test mode, swapping to live keys is a single Secrets update.
Integration method
Stripe is a native shared connector in Lovable — connect your Stripe account once in Settings → Connectors, then describe your Connect payment flows in chat and Lovable generates all required Edge Functions and frontend code automatically.
Prerequisites
- A Lovable account with an active project (free tier works for setup, Lovable Cloud required for deployment)
- A Stripe account — sign up free at stripe.com. You do NOT need to activate live payments to start building with test mode.
- A basic understanding of your marketplace flow: who is the platform, who are the connected accounts (sellers/providers), and how should fees be split
- Your Stripe publishable key and secret key from the Stripe Dashboard → Developers → API keys
- Your Stripe webhook signing secret (created in Stripe Dashboard → Developers → Webhooks after deployment)
Step-by-step guide
Connect your Stripe account via Lovable's native connector
Connect your Stripe account via Lovable's native connector
Lovable's native Stripe connector is the fastest way to get started. Navigate to your Lovable project, then open Settings by clicking the gear icon in the top-right corner of the editor. In the left sidebar of Settings, click 'Connectors', then scroll down to find 'Shared connectors'. You will see the full list of 17 available connectors — locate Stripe and click 'Connect'. Lovable will open a secure connection dialog. Click 'Add API Key' and you will see a form with two fields: your Stripe publishable key (starts with pk_test_ in test mode) and your Stripe secret key (starts with sk_test_). Find these in your Stripe Dashboard by navigating to Developers → API keys. Copy each key and paste it into the form — never type API keys anywhere in the Lovable chat, as on free tier chat history can be publicly visible. Click 'Save'. Once saved, the Stripe connector will show as 'Connected' with a green indicator. This does two things: it stores your keys encrypted in Lovable Cloud Secrets where Edge Functions can access them via Deno.env.get(), and it gives Lovable's AI full awareness of your Stripe configuration so it can generate accurate Connect-specific code. You are now ready to describe your marketplace flow in chat.
I've connected my Stripe account. I'm building a marketplace where sellers can sign up, list services, and get paid. When a customer pays for a service, I want to take a 15% platform fee and send the rest to the seller. Please set up Stripe Connect with Express accounts for seller onboarding. I need: a seller onboarding flow using Stripe Connect's hosted onboarding, a way to track which sellers have completed onboarding, and a checkout flow that splits payment between the seller and my platform.
Paste this in Lovable chat
Expected result: The Stripe connector shows 'Connected' in Settings → Connectors → Shared connectors with a green status indicator. Lovable's AI confirms it can see your Stripe configuration and is ready to generate Connect-specific code.
Set up seller onboarding with Stripe Connect Express accounts
Set up seller onboarding with Stripe Connect Express accounts
Stripe Connect offers three account types for connected sellers: Standard (sellers manage their own Stripe account), Express (Stripe hosts a simplified onboarding dashboard, recommended for most marketplaces), and Custom (you build your own onboarding UI, maximum control but significant complexity). For most Lovable projects, Express accounts are the right choice — Stripe handles identity verification, bank account collection, and compliance so you do not need to build any of that yourself. Describe your onboarding flow to Lovable in chat. The AI will generate an Edge Function that creates a Stripe Connect account link using the Stripe API, plus a frontend page where sellers can click 'Set up payments' to begin the Stripe-hosted onboarding. Lovable will also create a database table to store each seller's Stripe account ID and onboarding status — this is critical because you need the connected account ID to route payments to the correct seller later. After Lovable generates the code, you need to register two callback URLs in your Stripe Dashboard. Go to Stripe Dashboard → Connect → Settings → Redirect URIs and add your Lovable deployment URL followed by /seller/onboarding/complete for the success redirect and /seller/onboarding/refresh for the re-onboarding redirect. These are the URLs Stripe sends sellers back to after completing the hosted onboarding form. Use your deployed Lovable Cloud URL — not the preview URL — because Stripe requires real HTTPS endpoints.
Create a seller onboarding page at /seller/onboarding. When a seller clicks 'Start setup', call a Stripe Connect Edge Function to create an account link for an Express connected account. Store the returned Stripe account ID in a 'seller_profiles' table with columns: user_id, stripe_account_id, onboarding_complete (boolean), created_at. After the seller completes Stripe's hosted onboarding and returns to /seller/onboarding/complete, update their onboarding_complete status to true. Show a dashboard with their payout status if onboarding is done, or a 'Complete setup' button if it is not.
Paste this in Lovable chat
Expected result: A /seller/onboarding page exists with a 'Start setup' button. Clicking it redirects to Stripe's hosted onboarding form. After completing, sellers return to your app and see their payout dashboard. The seller_profiles table in your Lovable Cloud database stores each seller's Stripe account ID and onboarding status.
Build the payment flow with platform fees
Build the payment flow with platform fees
This is the core of Stripe Connect: charging a customer and automatically splitting the payment between your platform and a connected seller. The key concept is the 'application_fee_amount' parameter in Stripe's Payment Intent API — you specify the total charge amount, the connected account to pay, and how much your platform keeps as a fee. Stripe handles the split automatically. Lovable will generate a Checkout Edge Function that creates a Stripe Checkout Session with the on_behalf_of parameter set to the seller's Stripe account ID and application_fee_amount set to your platform fee. Customers see a standard Stripe Checkout page, enter their card details, and the payment completes. The seller receives their portion in their connected Stripe account balance on Stripe's payout schedule. An important architectural note: the Edge Function needs to look up the seller's stripe_account_id from your database before creating the Checkout Session. Lovable will handle this wiring automatically if you describe the data relationship clearly in your prompt. Make sure to test with Stripe's test card number 4242 4242 4242 4242 (any future expiry, any CVC) and a connected test account — Stripe provides test onboarding flows that skip real identity verification so you can test end-to-end without real bank accounts.
Create a checkout flow for customers to pay for services. When a customer clicks 'Book service' on a seller's listing, create a Stripe Checkout Session using the seller's stripe_account_id from the seller_profiles table. Set the platform fee to 15% of the service price using application_fee_amount. After successful payment, redirect the customer to /booking/success and save the booking to a 'bookings' table with columns: id, customer_id, seller_id, service_id, amount_paid, platform_fee, stripe_session_id, status, created_at. Show an order confirmation page at /booking/success.
Paste this in Lovable chat
Expected result: Clicking 'Book service' on a listing redirects customers to a Stripe Checkout page showing the service price. After entering test card 4242 4242 4242 4242 and completing payment, customers land on /booking/success. In your Stripe test dashboard, the payment appears with a platform fee deducted and the remainder shown as a transfer to the connected account.
Configure webhook handlers for Connect events
Configure webhook handlers for Connect events
Webhooks are how Stripe notifies your app when important events happen asynchronously — a seller completes onboarding, a payout succeeds or fails, or a customer disputes a charge. For Stripe Connect specifically, you need to listen to both account events (things happening on your platform account) and Connect events (things happening on connected accounts). Without webhooks, your database will not reflect real-time payment and onboarding status accurately. Lovable will generate a webhook Edge Function that receives POST requests from Stripe, verifies the signature using your webhook signing secret, and processes events. The critical technical detail here is that Deno requires the async version of Stripe's webhook constructor: constructEventAsync() rather than the synchronous constructEvent() used in Node.js. Lovable knows this and will use the correct async version automatically — but if you ever modify the webhook code manually, make sure you do not accidentally switch to the synchronous version. To get your webhook signing secret: first deploy your Lovable project so you have a live HTTPS URL. Then go to Stripe Dashboard → Developers → Webhooks → Add endpoint. Enter your webhook URL (your Lovable deployment URL followed by the Edge Function path, typically something like https://your-project.lovable.app/functions/v1/stripe-webhook). Select the events you want to listen for: account.updated (seller onboarding status changes), payment_intent.succeeded (payments completed), payout.paid (sellers received their money), and charge.dispute.created (chargebacks). Copy the signing secret that appears after saving, then go to Lovable Cloud → Secrets and save it as STRIPE_WEBHOOK_SECRET.
Create a Stripe webhook handler Edge Function at /functions/v1/stripe-webhook. It should verify the webhook signature using STRIPE_WEBHOOK_SECRET with constructEventAsync() (required for Deno). Handle these events: account.updated — update the seller's onboarding_complete status in seller_profiles when their Stripe account becomes fully verified; payment_intent.succeeded — update the booking status to 'confirmed' in the bookings table; charge.dispute.created — mark the relevant booking as 'disputed' and send an internal notification. Return 200 for all handled events and 400 for signature verification failures.
Paste this in Lovable chat
Expected result: A webhook Edge Function is deployed and visible in Lovable Cloud → Logs. In Stripe Dashboard → Developers → Webhooks, your endpoint shows as active with recent delivery attempts. Triggering a test webhook from the Stripe dashboard (using the 'Send test webhook' button) logs a successful 200 response in Lovable Cloud → Logs.
Switch to live mode and go to production
Switch to live mode and go to production
After testing your entire flow end-to-end with Stripe test mode keys and test card numbers, switching to production is a straightforward secrets update. Do not change any code — only update the API keys stored in Lovable Cloud Secrets. In your Stripe Dashboard, make sure your platform account has completed full activation: go to Dashboard → Settings → Account and verify that all required business information, bank account details, and identity verification steps are complete. Stripe requires platform activation before you can process live payments. Your connected accounts (sellers) also need to complete their Express onboarding with real information — the test onboarding you used for development accepted placeholder data. Once your Stripe account is activated, navigate to Stripe Dashboard → Developers → API keys and switch the toggle from 'Test mode' to 'Live mode'. Copy your live publishable key (pk_live_...) and live secret key (sk_live_...). In your Lovable project, go to Cloud tab → Secrets and update STRIPE_PUBLISHABLE_KEY and STRIPE_SECRET_KEY with the live values. Create a new webhook endpoint in Stripe's live mode dashboard pointing to the same Edge Function URL, and update STRIPE_WEBHOOK_SECRET in Lovable Cloud Secrets with the live webhook signing secret. Publish your Lovable project after updating secrets to ensure the new values are active. For complex go-live scenarios or if you need help reviewing your Connect configuration, RapidDev's team has experience setting up Stripe Connect for Lovable marketplace projects.
My Stripe integration is tested and working. I've updated STRIPE_PUBLISHABLE_KEY, STRIPE_SECRET_KEY, and STRIPE_WEBHOOK_SECRET in Lovable Cloud Secrets with live mode values. Please verify that all Stripe-related Edge Functions use Deno.env.get() for these secrets (not hardcoded values), that the frontend uses the publishable key only (never the secret key), and that all payment amounts are in the correct currency minor units (cents for USD). Add a prominent test mode warning banner to the checkout page that only shows when the publishable key starts with pk_test_.
Paste this in Lovable chat
Expected result: All Stripe Edge Functions use Deno.env.get() for API keys. The frontend only references the publishable key. A test mode warning banner appears on checkout when using test keys and disappears automatically when live keys are active. Your Lovable project is ready to process real payments.
Common use cases
Build the payment flow with platform fees
Use Stripe Connect with Lovable to build the payment flow with platform fees. This is one of the most common use cases when integrating Stripe Connect into your Lovable application.
I've connected my Stripe account. I'm building a marketplace where sellers can sign up, list services, and get paid. When a customer pays for a service, I want to take a 15% platform fee and send the rest to the seller. Please set up Stripe Connect with Express accounts for seller onboarding. I need: a seller onboarding flow using Stripe Connect's hosted onboarding, a way to track which sellers have completed onboarding, and a checkout flow that splits payment between the seller and my platform.
Copy this prompt to try it in Lovable
Configure webhook handlers for Connect events
Take your Stripe Connect integration further by configure webhook handlers for connect events. This builds on the basic setup to create a more complete experience.
Create a seller onboarding page at /seller/onboarding. When a seller clicks 'Start setup', call a Stripe Connect Edge Function to create an account link for an Express connected account. Store the returned Stripe account ID in a 'seller_profiles' table with columns: user_id, stripe_account_id, onboarding_complete (boolean), created_at. After the seller completes Stripe's hosted onboarding and returns to /seller/onboarding/complete, update their onboarding_complete status to true. Show a dashboard with their payout status if onboarding is done, or a 'Complete setup' button if it is not.
Copy this prompt to try it in Lovable
Switch to live mode and go to production
Prepare your Stripe Connect integration for production by switch to live mode and go to production. Ensures your integration works reliably for real users.
Create a checkout flow for customers to pay for services. When a customer clicks 'Book service' on a seller's listing, create a Stripe Checkout Session using the seller's stripe_account_id from the seller_profiles table. Set the platform fee to 15% of the service price using application_fee_amount. After successful payment, redirect the customer to /booking/success and save the booking to a 'bookings' table with columns: id, customer_id, seller_id, service_id, amount_paid, platform_fee, stripe_session_id, status, created_at. Show an order confirmation page at /booking/success.
Copy this prompt to try it in Lovable
Troubleshooting
Stripe payments work in Stripe's test dashboard but the booking status never updates in my Lovable database
Cause: Webhooks are not reaching your Edge Function. This is usually because the webhook endpoint URL was registered before the Edge Function was deployed, the URL is incorrect, or the STRIPE_WEBHOOK_SECRET in Lovable Cloud Secrets does not match the signing secret for that specific webhook endpoint.
Solution: Go to Stripe Dashboard → Developers → Webhooks and click your endpoint. Check the 'Recent deliveries' tab — failed deliveries show the HTTP status code returned by your Edge Function. A 400 error usually means signature verification failed (wrong STRIPE_WEBHOOK_SECRET). A 500 error means the Edge Function crashed — check Lovable Cloud → Logs for the error details. To verify your secret is correct, delete the webhook endpoint in Stripe, create a new one pointing to the same URL, and copy the new signing secret into Lovable Cloud → Secrets as STRIPE_WEBHOOK_SECRET.
Seller onboarding redirects to Stripe but returns to my app with an error, and the seller's onboarding_complete stays false
Cause: The return URL registered in Stripe Connect settings does not match the actual URL of your deployed Lovable app, or the Edge Function that handles the return callback is not updating the database correctly.
Solution: In Stripe Dashboard → Connect → Settings → Redirect URIs, verify the URL matches your exact Lovable deployment URL including the path (e.g., https://your-project.lovable.app/seller/onboarding/complete). The URL must be HTTPS — the Lovable preview URL (which uses a different format) will not work. If the URL is correct, check Lovable Cloud → Logs for errors in the onboarding complete Edge Function. A common issue is the Edge Function trying to update a seller record that does not yet exist — make sure seller_profiles is created when the user first starts onboarding, not only when they complete it.
Payment completes successfully but the connected seller account shows no funds received
Cause: The on_behalf_of or transfer_data parameter in the Checkout Session was not set, or the seller's Stripe account ID stored in your database is incorrect or from test mode.
Solution: In Stripe Dashboard → Payments, click the completed payment and look for a 'Transfer' section. If there is no transfer listed, the payment went to your platform account only — the connected account was not specified. Ask Lovable to log the stripe_account_id being used when creating the Checkout Session and verify it matches a real connected account in Stripe Dashboard → Connect → Accounts. Also check whether you are mixing test mode and live mode account IDs — test connected account IDs (acct_test_...) will not work in live mode.
Best practices
- Always use Stripe test mode keys (pk_test_, sk_test_) during development and only switch to live keys (pk_live_, sk_live_) immediately before going to production — test mode is a full simulation environment with no risk of real charges.
- Store every Stripe credential — publishable key, secret key, and webhook signing secret — in Lovable Cloud → Secrets using exact uppercase names like STRIPE_SECRET_KEY. Never paste API keys into the Lovable chat, especially on free tier where chat history may be visible.
- Verify webhook signatures using constructEventAsync() (not constructEvent()) in every Stripe Edge Function — Deno's runtime requires the async version, and skipping signature verification opens your app to forged webhook attacks.
- Test the complete payout flow before going live: onboard a test connected account, make a test payment, verify the transfer appears in both your platform dashboard and the connected account dashboard, and trigger a test payout to confirm bank account details are correct.
- Track connected account onboarding status in your own database (seller_profiles.onboarding_complete) rather than querying Stripe's API on every page load — Stripe account status changes arrive via webhook, so keep your local record in sync and use it for fast UI rendering.
- Use Stripe Express accounts for most marketplace use cases — they give sellers a Stripe-hosted dashboard for managing their payouts and tax forms while keeping your integration complexity low. Only use Custom accounts if you need full control over the onboarding UI.
- Set up Stripe's automatic email notifications for connected accounts so sellers receive payout confirmations directly from Stripe — this reduces support requests and is free to enable in Stripe Dashboard → Connect → Settings → Email settings.
- Before launching, review your platform fee percentage against Stripe Connect's pricing (0.25% + 25 cents per payout for Express accounts) to make sure your economics work — your platform fee needs to cover Stripe's Connect fee in addition to the standard payment processing fee.
Alternatives
Standard Stripe integration for single-party payments — choose this if you are collecting payments for your own business rather than routing money to third-party sellers or service providers.
PayPal's mass payout API for sending money to multiple recipients simultaneously — useful if your sellers or contractors already have PayPal accounts and prefer PayPal over bank transfers.
Square's payment platform with built-in point-of-sale hardware support — consider this if your marketplace includes in-person transactions or your sellers operate physical retail locations.
Enterprise-grade payment platform used by large marketplaces like eBay and Etsy — consider this when you outgrow Stripe Connect's scale or need more advanced financial product features for your platform.
Frequently asked questions
What is the difference between Stripe and Stripe Connect in Lovable?
The standard Stripe connector in Lovable handles single-party payments — a customer pays your business. Stripe Connect is specifically for multi-party payments where your platform routes money to connected accounts like sellers, freelancers, or service providers. If you are building a marketplace, gig economy app, or any platform where third parties receive payouts, you need Stripe Connect. If you are just charging customers for your own products or subscriptions, the standard Stripe connector is sufficient.
Does Stripe Connect work in Lovable's preview mode?
No — Stripe Connect requires real HTTPS endpoints for webhook delivery and OAuth redirect URLs, which means it only works with your deployed Lovable Cloud URL. Use Stripe test mode keys (pk_test_, sk_test_) during development so you can test with fake card numbers and fake bank accounts without real money moving. Once your flow works in test mode against your deployed URL, switching to live mode is just a matter of updating the secrets in Cloud → Secrets.
What type of Stripe Connect account should I use for my sellers?
Express accounts are the right choice for most Lovable marketplaces. With Express, Stripe hosts the onboarding form and gives sellers a Stripe-managed dashboard for viewing their balance and payouts — you do not need to build any of that UI yourself. Standard accounts give sellers more control but require them to have their own separate Stripe account. Custom accounts let you build a fully branded onboarding experience but require significantly more development work and legal responsibility. Start with Express unless you have a specific reason to need the others.
How do I handle sellers in different countries?
Stripe Connect supports connected accounts in 45+ countries. When creating an account link for onboarding, you can specify the country parameter to pre-select the correct country for the seller, which determines which identity documents and bank account formats Stripe requests. Some payment methods and payout schedules vary by country — for example, SEPA Direct Debit for European sellers and ACH for US sellers. Lovable's AI will generate the basic Connect flow, but for multi-country marketplace requirements you may need to specify country-specific behavior explicitly in your prompts or review Stripe's documentation for each target market.
What happens if a customer disputes a payment on my marketplace?
By default on Stripe Connect, your platform account is responsible for disputes (chargebacks) even though the payment was partially transferred to a connected seller. Stripe will debit the disputed amount from your platform account balance. You should handle the charge.dispute.created webhook event to flag the booking as disputed in your database and pause any pending payouts to the seller for that transaction. Consider building a seller agreement into your onboarding that defines your chargeback policy, and maintain a platform reserve balance in your Stripe account to cover potential disputes.
Can I set different platform fee percentages for different sellers or services?
Yes — the application_fee_amount parameter is set per transaction when creating a Checkout Session, so you can calculate different fee amounts dynamically based on seller tier, service category, or any other business logic. Store your fee tiers in your Lovable database (for example, a seller_tiers table with a fee_percentage column) and have your Edge Function look up the applicable fee before creating the Checkout Session. Lovable can generate this logic if you describe your fee structure in your chat prompt.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation