Real-time inventory sync across Shopify, Amazon and eBay: how I build it in week 2.
If you're a UK seller running across Shopify plus Amazon plus eBay — and especially if you're somewhere between 100 and 1,000 orders/day — you've already lived the failure mode this post is about. You sold the last unit on Shopify at 14:32, Amazon didn't know about it until 14:34, the customer placed an order at 14:33, and now you're refunding, eating the FBA fee, taking an ODR hit, and the buyer is leaving you a one-star review for "item not as described."
Multi-channel inventory sync isn't glamorous. It's the unsexy plumbing that decides whether a UK e-commerce business is profitable or constantly haemorrhaging margin to refund-and-apologise loops. Here's exactly how I build it in week 2 of a 12-week engagement, what the architecture looks like in code, and — importantly — when you should buy Linnworks or Veeqo instead of paying me to write anything.
First — do you actually need real-time inventory sync?
Be honest with yourself before you write a cheque to me or anyone else. Custom multi-channel sync is overkill when:
- You're under 50 orders/day total. A daily manual reconciliation at 8am works. You'll oversell occasionally and that's cheaper than any system designed to prevent it.
- One channel does 90%+ of revenue. If Shopify is 95% of your sales and Amazon/eBay are noise, use Shopify as your master and push a CSV to the others twice a day. That's a 20-line script, not a 12-week engagement.
- You hold deep stock per SKU. If your slowest-moving line has 200 units on the shelf and your fastest mover has 800, the cost of oversells is so low that 30-minute polling is fine.
- You only sell unique-ID items. Cars, antiques, custom commissions — each listing is its own SKU with quantity 1. You don't need sync, you need a "delist on sale" rule.
- You have nobody technical on the team. Custom code without a maintenance plan rots. A SaaS vendor at least has a team patching theirs every Tuesday.
If any of those apply, off-the-shelf at the entry tier (Sellbrite, Multiorders, Linnworks Starter) will run you £100-300/month and do the job. Don't pay £15k for a problem that £150/month already solves.
If you're at 100+ orders/day across three or more channels, holding shallow stock (under 30 units per SKU on fast movers), and routinely refunding for oversells — keep reading. That's the bracket where the maths flips. I wrote about that specific bracket in the Shopify warehouse build at 100 orders/day.
Why "real-time" actually means 30-90 seconds
The first thing to set expectations on: there is no such thing as sub-second multi-channel inventory sync in the UK in 2026. Anyone telling you otherwise is selling marketing copy.
Here's the actual latency floor for each channel:
- Shopify — webhooks fire within 1-3 seconds of order creation. The
inventoryAdjustQuantitiesGraphQL mutation returns in 200-500ms. Effective round-trip from order-paid to other-channel-updated: 2-4 seconds if everything is healthy. - Amazon SP-API — listings updates take 30-120 seconds to propagate to the buy box after a
PATCH /listings/2021-08-01/items/{sellerId}/{sku}. The Feeds API (JSON_LISTINGS_FEED) is slower — typically 2-15 minutes per submission. Order notifications via the Notifications API land in 60-180 seconds via your SQS queue. - eBay —
ReviseInventoryStatuson the Trading API is near-instant on the call but takes 30-90 seconds to reflect on the listing page. The newer Sell Inventory APIbulkUpdatePriceQuantityis similar, with the added constraint of 25 SKUs per call.
So when I say "real-time" I mean: an order arrives on any channel and all other channels reflect the new stock level within 30-90 seconds in the worst case, typically under 30. That's the realistic ceiling. Pretending it's faster sets you up for an architecture that promises what physics won't deliver.
The honest design implication: you can't rely on sync alone to prevent overselling at the margin. You also need a reserved-stock buffer — typically 1-3 units per fast-moving SKU that you don't advertise on any channel. The buffer absorbs the conflict when two channels race to take the last unit during the 30-90 second blind window. More on that below.
The architecture I ship in week 2
My 12-week engagement starts with read before write. Week 1 is order ingest — pulling orders from every channel into your Postgres so there's one place to look. Week 2 is the inverse: pushing inventory changes back out so the channels stay in sync with what's actually on the shelf.
That order matters. If you build sync before ingest, you have nothing authoritative to sync from. The single source of truth has to exist first. By the end of week 1, every stock-affecting event (order received, refund processed, manual count, supplier delivery) writes to a stock_movements table with an immutable audit trail.
Week 2 layers on the write path. The stack is Postgres + Python (FastAPI) + a worker (RQ) running on Render or Hetzner. Boring, cheap, easy to maintain.
1. The stock_movements ledger
Append-only table. Every quantity change writes a row. Never updated, never deleted. The current stock for a SKU is SUM(quantity_delta), materialised into a stock_levels view refreshed on insert.
CREATE TABLE stock_movements (
id BIGSERIAL PRIMARY KEY,
sku TEXT NOT NULL,
warehouse_id INT NOT NULL,
quantity_delta INT NOT NULL,
reason TEXT NOT NULL, -- 'order', 'refund', 'count', 'delivery'
source_channel TEXT, -- 'shopify', 'amazon', 'ebay', 'manual'
source_ref TEXT, -- order id, refund id, count id
sync_token UUID, -- used for echo suppression
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX ON stock_movements (sku, created_at);
2. Channel adapters
One module per channel, all implementing the same interface: push_stock(sku, qty, token). The orchestrator doesn't care how Shopify differs from Amazon.
- Shopify — GraphQL
inventoryAdjustQuantitiesagainst the location'sInventoryLevel. Rate-limited at 50 points/second on standard plans. - Amazon — SP-API
PATCH /listings/2021-08-01/items/{sellerId}/{sku}with a JSON patch updatingfulfillment_availability[].quantity. Rate-limited at 5 requests/second per seller. - eBay — Sell Inventory API
bulkUpdatePriceQuantity, batched in groups of 25 to respect the API ceiling.
3. The event worker
Listens for changes via Postgres LISTEN/NOTIFY. For each new movement, it looks up which channels list the affected SKU and enqueues a push job per channel. Jobs retry on failure with exponential backoff and dead-letter to Slack after 5 attempts.
4. The reserved-stock buffer
For every SKU, the quantity pushed to channels is current_stock - buffer. Buffer defaults to 2 for fast-movers, configurable per SKU. This is the physical layer that protects you from the 30-90 second sync window.
5. Reconciliation cron
Every 15 minutes, a worker pulls the current quantity from each channel and compares to what Postgres thinks should be there. Any drift larger than the buffer triggers a Slack alert. This catches webhook failures, rate-limit drops, and the occasional Amazon "we lost your update" silent fail.
The race conditions that break v1 of every sync system
The first version of any DIY sync system breaks the moment two orders arrive at the same time on different channels for the same SKU. Here's what actually goes wrong, and how I handle it.
Race 1 — concurrent decrements. A Shopify webhook for order A and an Amazon notification for order B both arrive at 14:32:01 for SKU XYZ which has 1 unit in stock. Without proper locking, both transactions read current_stock = 1, both decide they can fulfil, both write quantity_delta = -1, and you've sold 2 units of a 1-unit SKU.
The fix is a single transactional path: every decrement goes through a Postgres function that uses SELECT ... FOR UPDATE on the stock_levels row, checks availability under the lock, and either inserts the movement or raises an InsufficientStock exception. The exception bubbles up to the channel adapter, which triggers that channel's cancellation flow (Shopify: cancel + refund; Amazon: cancel reason NoInventory; eBay: refund + cancel via the Cancellation API).
Race 2 — delayed webhook arriving after a manual count. The warehouse manager updates a stock count manually at 14:30 — the new authoritative quantity is 12. A delayed Shopify webhook from 14:28 arrives at 14:31 trying to decrement based on a stale view. Without sequencing, you write a delta on top of a manual count and the number is wrong.
The fix is that manual counts are absolute writes, not deltas. A count operation inserts a balancing row that brings the SUM to the new target. Subsequent deltas from delayed webhooks are still safe because they're relative to whatever the current sum is, including the count adjustment.
Race 3 — sync-from-channel feedback loops. You push stock = 10 to Amazon. Amazon's own listing-update notification fires back saying "inventory changed to 10." If you naively process that, you write another movement and end up wrong. Worse, that movement triggers another outbound push, which triggers another inbound notification — an infinite loop that ratelimits all three channels within 30 seconds.
The fix is the sync_token UUID on every outbound push. Inbound notifications carry the same token in the metadata; if your event worker sees a token it just issued, the inbound is ignored as an echo.
These three races account for roughly 90% of the "our sync system is broken" tickets I've seen on other people's builds.
What this costs vs Linnworks, Veeqo and ChannelAdvisor
The honest comparison. SaaS multi-channel tools in the UK in 2026 sit in these brackets:
- Sellbrite / Multiorders — £100-300/month at SMB tier.
- Linnworks / Veeqo — £400-1,000/month for the full stack with channel connectors, label modules and picker apps.
- ChannelAdvisor / Brightpearl — £1,500-4,000/month at enterprise tier, sometimes with revenue-share clauses on top.
My engagement is £15k fixed for 12 weeks, then optional £500-750/month for ongoing maintenance and feature work. Over 5 years that's £45-60k total versus £24-60k for Linnworks/Veeqo at full whack, or £90-240k for the enterprise tier.
So on pure subscription maths, custom wins decisively versus enterprise tools and is roughly line-ball with mid-market SaaS. The case for custom isn't the subscription saving on its own — it's everything around it:
- You own the code. If I disappear, any competent UK developer can pick up a clean FastAPI/Postgres codebase.
- Your data lives in your Postgres. No vendor lock-in, no export limits, no per-order data fees that scale with success.
- Workflow fits your business. Your buffer rules, your reconciliation cadence, your specific carrier-allocation logic — built in, not configured around.
- Integration on your terms. Need a connection to a supplier's EDI feed, or Xero, or a niche 3PL's API? Add it as a module. Don't wait for a SaaS feature request that'll never ship.
I've written a more detailed side-by-side at Linnworks vs custom WMS, and the full menu of what I build for UK SMBs sits at warehouse software for UK SMBs.
The reverse case — when SaaS still wins — is unchanged from what I always tell people: under 50 orders/day, single-channel dominance, or no in-house technical contact to maintain custom code. In those cases, pay the £100-300/month and move on with your life.
Week 2, day by day
For anyone considering the engagement, here's what week 2 actually looks like — the boring operational truth.
Day 6 (Monday). Week 1's order ingest is live in staging. Orders from Shopify, Amazon and eBay are landing in Postgres. The stock_movements table exists but only contains rows from inbound orders. I add the sync_token column, the stock_levels materialised view, and the Postgres function for atomic decrements with SELECT FOR UPDATE.
Day 7-8 (Tuesday-Wednesday). Build the three channel adapters. Each is roughly 150-200 lines of Python — auth, the push call, error handling, retry logic, echo suppression. Tested against sandbox accounts where the channel offers one (Shopify and eBay do; Amazon SP-API requires live seller credentials with sandbox-region keys).
Day 9 (Thursday). Build the event worker. Wire it to LISTEN/NOTIFY on stock_movements. Implement the reserved-stock buffer logic. Push to a test SKU on each channel and verify the buy box / listing updates within the expected latency window of 30-90 seconds.
Day 10 (Friday). Build the 15-minute reconciliation cron and the Slack alerting. Run a deliberate drift test — manually edit a SKU on Amazon Seller Central, wait 15 minutes, confirm Slack pings with the diff and the auto-correction movement. Deploy to staging. Hand-off demo to the client at 4pm.
Sync is live in staging by end of day 10. Week 3 starts the picker UI. We do not switch production sync on until end of week 5, after a full week of shadow mode — where the system computes what it would push but doesn't actually push — so you can compare against your existing process and catch any logic errors before they cause oversells in the real world.
That cautious rollout is the difference between a sync system that ships once and runs for 5 years, and one that becomes another spreadsheet on a manager's desktop within 3 months.
If you want me to build this for your business, the engagement is here: £15k fixed, 12 weeks.