This demo shows how marketplaces can automatically split payments between multiple vendors, with different commission rates per vendor and category.
// Multi-vendor marketplace split
const marketplaceSplit = {
splits: [
{
amount: 7649, // $76.49
label: 'TechStore Pro - Wireless Earbuds',
recipient: 'vendor_1_account_id',
metadata: { vendorId: 'techstore_pro' }
},
{
amount: 1350, // $13.50
label: 'Platform Commission - TechStore Pro',
recipient: 'platform_account_id'
},,
{
amount: 2399, // $23.99
label: 'Fashion Hub - Designer T-Shirt',
recipient: 'vendor_2_account_id',
metadata: { vendorId: 'fashion_hub' }
},
{
amount: 600, // $6.00
label: 'Platform Commission - Fashion Hub',
recipient: 'platform_account_id'
},,
{
amount: 3749, // $37.49
label: 'BookWorld - Programming Guide',
recipient: 'vendor_3_account_id',
metadata: { vendorId: 'bookworld' }
},
{
amount: 1250, // $12.50
label: 'Platform Commission - BookWorld',
recipient: 'platform_account_id'
},
{
amount: 999, // $9.99
label: 'Shipping Revenue',
recipient: 'platform_account_id'
}
],
metadata: {
orderId: 'MKT-1753541950934',
vendorCount: 3,
totalAmount: 17996
}
};
await gateway.processSplitPayment(marketplaceSplit);