Marketplace
Rules
- Multi-vendor data model:
User has one Seller profile — products belong to sellers, orders link buyer + seller
- Stripe Connect for payouts: onboard sellers with Connect Express — handles KYC, tax forms, bank accounts
- Commission: calculate platform fee as percentage — use
application_fee_amount on PaymentIntents or Checkout Sessions
- Escrow flow: capture payment on purchase, hold funds, transfer to seller on delivery confirmation or after dispute window
- Seller dashboard: separate layout with sales analytics, order management, product CRUD, payout history
- Buyer/seller reviews: one review per order, both directions — aggregate ratings with weighted average
- Search with seller filtering: include seller name, rating, location in search facets
- Seller onboarding: multi-step flow — business info → Stripe Connect → product listing → go live
Patterns
const account = await stripe.accounts.create({
type: "express",
email: seller.email,
metadata: { sellerId: seller.id },
});
const accountLink = await stripe.accountLinks.create({
account: account.id,
refresh_url: `${baseUrl}/seller/onboarding?refresh=true`,
return_url: `${baseUrl}/seller/onboarding/complete`,
type: "account_onboarding",
});
const session = await stripe.checkout.sessions.create({
line_items: [{ price: priceId, quantity: 1 }],
payment_intent_data: {
application_fee_amount: Math.round(price * 0.10),
transfer_data: { destination: seller.stripeAccountId },
},
mode: "payment",
success_url: `${baseUrl}/orders/{CHECKOUT_SESSION_ID}`,
cancel_url: `${baseUrl}/cart`,
});
Avoid
- Direct transfers without escrow — hold funds until delivery confirmed or dispute window passes
- Single Stripe account for all sellers — each seller needs their own Connect account for compliance
- Letting sellers set payout schedules — use platform-controlled payouts for fraud protection
- Missing seller verification — require Stripe Connect onboarding completion before going live
- Platform handling tax for sellers — Stripe Connect Express handles seller tax reporting