Headless E-Commerce & Split-Payment Backends
Multi-vendor commerce without the platform tax
A high-throughput GraphQL commerce API built for marketplaces and multi-vendor stores that Shopify simply cannot handle.
Core stack
FastifyGraphQLRedisStripe ConnectWhat's included
Shopify Was Not Built for What You're Building
Shopify is the right answer for a single-brand store selling physical or digital products. It is emphatically not the right answer for a marketplace where payments need to flow to multiple sellers simultaneously, where your product catalog changes by the minute, where the frontend is a React Native mobile app and a Next.js web app running from the same API, or where you need to take a platform fee and distribute the rest.
Tried to make Shopify do this? You've hit the Payments API limits. You've discovered that Shopify's multi-vendor support requires expensive third-party apps that charge a percentage of your GMV. You've realized that your checkout UI is constrained by what Shopify allows.
The Headless E-Commerce & Split-Payment Backend gives you a proper commerce infrastructure that you control completely.
Fastify + GraphQL: Why This Combination Specifically
Express.js is fine for most things. For high-throughput commerce APIs — where a flash sale might spike traffic 10x in 30 seconds — it starts to show its ceiling. Fastify is consistently 2–3x faster than Express in benchmarks and, more importantly, is architected to handle I/O concurrency at scale.
GraphQL solves the specific problem of serving multiple frontend clients (web, mobile, third-party integrations) from a single API without building separate REST endpoints for each consumer's data shape. Your web checkout needs different product fields than your mobile app. Your warehouse integration needs different order fields than your customer-facing order history page. With GraphQL, each client requests exactly what it needs.
The schema includes:
- Products, variants, inventory levels (with real-time webhooks on stock changes)
- Shopping carts with session persistence across devices via Redis
- Orders, fulfillments, and returns
- Seller profiles and their connected payment accounts
- Customer accounts with order history and saved payment methods
Stripe Connect: Splitting Payments the Right Way
If you've tried to do marketplace payments without Stripe Connect, you know the nightmare. You collect the payment, you manually calculate the split, you initiate a separate transfer. The transfer fails or gets held. Your refund logic becomes a multi-step accounting puzzle. Tax reporting is a disaster.
Stripe Connect handles marketplace payment flows natively. When a buyer checks out, the funds are held by Stripe and routed according to rules you define. Your platform fee is deducted first, then the seller's share is transferred to their connected account.
This codebase implements:
- Stripe Connect Onboarding — a custom onboarding flow for new sellers to connect their bank accounts, with the KYC/AML process handled by Stripe
- Application fees calculated as a percentage or flat fee per transaction, configurable per seller tier
- Automatic payouts to seller bank accounts on a schedule you define
- Escrow holds — funds can be held until buyer confirmation before releasing to the seller
- Dispute and refund handling — when a buyer disputes a charge, the logic for clawing back funds from the seller payout is built in
Sub-50ms Cart Performance With Redis
A slow checkout kills conversion. Abandoned cart rates spike sharply once load time exceeds 2 seconds. Cart operations — adding items, updating quantities, applying discount codes — need to feel instant.
Cart sessions are stored in Redis rather than the database. Reading and writing a cart operation takes under 5ms at the application level. Product catalog items that are read frequently (pricing, availability, images) are cached in Redis with configurable TTLs and invalidated automatically when inventory changes.
The cart abandonment webhook system fires a configurable time after a cart is created without checkout. The default is 1 hour, after which your CRM or email provider receives a webhook with the cart contents, customer details, and a pre-generated recovery link. The recovery link restores the exact cart state.
Inventory Management at Scale
Real-time inventory accuracy is critical for marketplaces — a product showing "In Stock" when it's actually sold out is a customer service crisis. The inventory system uses optimistic locking to handle concurrent purchases of the same item without overselling.
When stock levels fall below a configurable threshold, seller accounts and your admin panel receive automatic low-stock alerts. Inventory can be managed per-variant (size, color, edition) and per-warehouse location.
Lifetime access · Full source code
Secure checkout via Stripe · No subscription
Questions before purchasing? Talk to us →
Ready to stop building from scratch?
Get the complete, production-ready codebase today. One payment, lifetime access, instant download.