How to build connect marketplace integrations on Stripe
Stripe Connect allows you to build marketplace integrations by creating connected accounts for your sellers and facilitating payments between buyers and sellers. You'll need to set up your platform account, implement OAuth flows for seller onboarding, and handle payment processing with proper fee structures.
Prerequisites
- Stripe account with Connect enabled
- Basic understanding of webhooks and APIs
- Development environment with HTTPS
- Knowledge of OAuth 2.0 flow
Step-by-Step Instructions
Configure Stripe Connect Settings
Implement Connected Account Creation
stripe.accounts.create({
type: 'express',
country: 'US',
email: 'seller@example.com',
capabilities: {
card_payments: {requested: true},
transfers: {requested: true}
}
});Store the returned
account_id in your database linked to the seller's profile.Set Up Account Onboarding Flow
stripe.accountLinks.create({
account: 'acct_connected_account_id',
refresh_url: 'https://yourapp.com/reauth',
return_url: 'https://yourapp.com/return',
type: 'account_onboarding'
});Redirect sellers to the returned url to complete their verification process. Handle the return flow to check account status using
stripe.accounts.retrieve().Configure Webhook Endpoints
account.updated, payment_intent.succeeded, and transfer.created. Verify webhook signatures using:stripe.webhooks.constructEvent(
payload, signature, endpointSecret
);Implement Payment Processing
// Destination charge method
stripe.paymentIntents.create({
amount: 2000,
currency: 'usd',
transfer_data: {
destination: 'acct_connected_account_id',
amount: 1800 // minus platform fee
}
});Set your
stripe_account header when creating charges directly on connected accounts.Handle Platform Fees and Payouts
stripe.transfers.create({
amount: 1000,
currency: 'usd',
destination: 'acct_connected_account_id'
});Monitor payout schedules in Connect → Accounts and handle failed transfers through webhooks.
Test and Monitor Integration
Common Issues & Troubleshooting
Connected account onboarding fails or gets stuck
Check the account's requirements object via API to see what information is missing. Ensure all required fields are collected and capabilities are properly requested during account creation.
Payments fail with 'account not found' error
Verify you're using the correct stripe_account header and that the connected account is fully onboarded. Check account status is charges_enabled: true before processing payments.
Platform fees not appearing in dashboard
Ensure you're using application_fee_amount parameter in PaymentIntents or setting application_fee in destination charges. Check that your Connect settings allow fee collection.
Webhook events not being received
Verify webhook endpoint URLs are accessible via HTTPS and return 200 status codes. Check Webhook logs in dashboard for delivery failures and ensure you're listening for the correct event types.