Skip to main content
A marketplace is a step harder than a regular SaaS — money has to flow from buyers to sellers, with you as the platform taking a cut. Stripe Connect handles the hard parts (KYC, payouts, compliance). vly wires it into your app. This recipe builds an end-to-end two-sided marketplace. Time: ~90 minutes. Difficulty: Advanced.

What you’ll build

A marketplace where:
  • Sellers create listings with a price.
  • Buyers browse listings, click “Buy”, and pay via Stripe.
  • Money flows: 90% to the seller, 10% to the platform.
  • Sellers onboard via Stripe Connect Express (KYC, bank account).
  • Payouts are automatic — Stripe sends the money.

Prerequisites

Step 1 — Project foundation

Use Plan mode. Submit, review the plan, approve. Build takes ~2 minutes. vly will prompt you to provide Stripe credentials. Paste your sk_test_... and pk_test_... keys.

Step 2 — Test buyer flow

Once built, sign up as a buyer:
  1. Browse the (empty) homepage — no listings yet.
  2. We need to create a seller and a listing first.

Step 3 — Test seller onboarding

Sign up as a different user (incognito). Click Become a seller. vly redirects to Stripe’s hosted Connect Express onboarding. In test mode, you can fast-forward through verification with Stripe’s test data:
Routing: 110000000 Account: 000123456789
After Stripe redirects back to your app, the user’s stripeOnboardingComplete should be true.

Step 4 — Create a listing

Still as the seller, go to /sell/new:
  • Title: “Vintage typewriter”
  • Description: “1965 Olivetti, fully working”
  • Price: $50.00
  • Image: paste any image URL
Submit. The listing appears on the homepage.

Step 5 — Test buyer flow end-to-end

Switch back to the buyer browser:
  1. Open the homepage. The listing appears.
  2. Click into it. Click Buy.
  3. Redirected to Stripe Checkout. Use test card 4242 4242 4242 4242, any future expiry, any CVC.
  4. After successful payment, redirected back to a success page.
In your Stripe dashboard:
  • The payment shows as completed.
  • $50 charged to the buyer.
  • Connected account (the seller) receives $45 (90%).
  • Platform receives $5 (10%) as application_fee_amount.
The transfer happens automatically via Stripe Connect.

Step 6 — Webhook for purchase confirmation

vly already wired up the webhook. To verify:
  1. Stripe dashboard → Webhooks → find the endpoint.
  2. Send a test checkout.session.completed event.
  3. The vly app receives it, marks the purchase as succeeded in the DB.
In production, you’ll need to register a real webhook endpoint and set the signing secret. vly will guide you through this.

Step 7 — Refunds (admin path)

For disputes or seller-initiated refunds: Test with a real charge and refund.

Going to production

1

Activate your Stripe account

Provide business details, bank account, identity. Required for live mode.
2

Switch keys

Replace sk_test_... and pk_test_... with sk_live_... and pk_live_... in vly’s production environment.
3

Register a production webhook

Use your custom domain URL. Copy the new signing secret to production env.
4

Set up your platform's payout schedule

In Stripe → Settings → Payouts. Daily, weekly, or manual.
5

Customer support

Set up a disputes@yourapp.com inbox; Stripe forwards customer dispute notifications here.

Common variations

Replace checkout.sessions.create({ mode: "payment" }) with mode: "subscription". Listings become “Subscribe” with a recurring price.
Use Stripe’s delayed transfer. Charge the buyer immediately, transfer to the seller after a manual confirmation step.
Replace single-listing checkout with a cart that aggregates line_items across multiple sellers. Use Stripe’s destination charges with multiple transfers.
Stripe Connect Express supports payouts in 40+ countries. Each seller’s account is regional; the marketplace just sends the transfer.
Buyer-pays-fee: present the price as $50 + $5 platform fee = $55. Use Stripe’s application_fee_amount either way; UI presentation differs.

Things to watch

Sellers can drop out partway through Stripe onboarding. Periodically check account.charges_enabled and prompt them to finish.
These hit your platform balance, not the seller’s. Set up a reserve or insurance for high-risk categories.
Stripe Tax can calculate and remit. For complex cross-border, talk to a tax advisor.
Stripe Radar (built into Stripe) handles most fraud. For high-risk categories, add manual review on first-time sellers.

Stripe integration

Full reference for the Stripe integration.

Subscription billing

Subscription marketplaces.

Multi-tenant SaaS

The base pattern for B2B variants.
Last modified on April 18, 2026