Stripe Connect

Onboard sellers and split payments to their connected accounts for marketplace use.

Overview

Stripe Connect turns Icone Pay into a marketplace: you onboard sellers to Stripe Express accounts, then route a card payment to a seller while automatically taking your platform fee. The flow is: create the account → send the seller to onboard → once active, pass their sellerId to init-payment.

Onboard a Seller

Create (or re-issue onboarding for) a seller's account and send them to the returned onboardingUrl.

const res = await icone.createConnectAccount({
  sellerId: "seller_42",
  email: "seller@example.com",
  country: "US",            // optional
  businessType: "individual",
});
// redirect the seller to res.onboardingUrl

Check Status

A seller can receive payments only once chargesEnabled is true. Poll their status with getConnectAccount.

const res = await icone.getConnectAccount("seller_42");
if (res.connected && res.account?.chargesEnabled) {
  // ready to receive marketplace payments
}

Take a Payment

Pass the seller's sellerId to init-payment. The charge is routed to their connected account and your platform fee is deducted automatically.

await icone.initPayment({
  action: "purchase",
  referenceId: "order_777",
  amount: 50,
  currency: "usd",
  sellerId: "seller_42",   // routes to this seller
  items: [{ name: "Handmade bag", quantity: 1, unitPrice: 50 }],
  successUrl: "https://market.com/thanks",
  cancelUrl: "https://market.com/cart",
});
Marketplace card payments use card currencies (usd, dop, clp). If a seller isn't onboarded, the payment falls back to your platform Stripe account.

Generate fresh links for a seller at any time:

// New onboarding (or "account_update") link
const link = await icone.createConnectAccountLink("seller_42");

// Express Dashboard login link (only for onboarded sellers)
const dash = await icone.getConnectDashboardLink("seller_42");