Shared Inventory Shopify App
Eliminated overselling across variants pulling from shared physical stock
The Problem
Shopify merchants selling materials by size, bundle kits, or made-to-order products face a problem the platform doesn't solve natively: multiple variants pulling from the same physical stock.
A fabric seller offering 1oz, 4oz, and 16oz cuts from the same bolt. A coffee shop selling whole bean and ground from the same batch. A kit maker whose components are also sold individually. When someone orders the 16oz cut, the 1oz availability should drop by 16 units. Shopify treats them as independent inventory.
The result is overselling, manual reconciliation every night, and customer service explaining why that order can't be fulfilled. Existing apps tackle the basic sync problem but miss the operational reality: webhooks arrive out of order, staff edit inventory directly in Shopify admin, and merchants need visibility into pool health before things break.
The Approach
I built an embedded Shopify app where merchants create inventory pools, map variants with consumption multipliers (1oz = 1 unit, 4oz = 4 units), and orders automatically deduct from the pool across all linked variants.
The architecture had to solve three problems beyond basic sync. First, webhook deduplication. Shopify delivers duplicate webhooks regularly. I used Upstash Redis with a 48-hour TTL to dedupe by event ID before any processing.
Second, reconciliation drift. Expected inventory diverges from actual over time due to failed webhooks, external edits, and race conditions. I built an hourly reconciliation engine using Upstash QStash (swapped in from BullMQ because Amplify is serverless and can't run long-lived workers). The engine compares pool state against Shopify's actual inventory and surfaces drift before it becomes overselling.
Third, external edits. When staff adjusts inventory in Shopify admin, the pool needs to know. The app detects these changes and prompts merchants to reconcile instead of silently breaking.
Pool health dashboard was the differentiator. Every competing app shows you what's synced. None show you pool health, reconciliation status, or drift over time. Merchants get to see the system working.
The Stack
The Result
Webhook deduplication with 48-hour Redis TTL
Hourly reconciliation engine catching drift before oversells
Safety buffer mitigating webhook-delay race conditions
Pool health dashboard with drift visualization
Interested in similar results for your project?
Start a conversation