
Case study · Systems integration
Custom order middleware connecting WooCommerce, Zoho, ShipStation and Xero.
Working directly with Ultra Soft’s director, we architected and deployed a standalone Python and PostgreSQL order middleware on hardened UK infrastructure, replacing fragile sync scripts with a strict, auditable state machine.
- Client
- Ultra Soft · UK water treatment supplier
- Status
- In production since September 2026; G3 (Xero accounting) in build
- Stack
- Python, Flask, PostgreSQL, Caddy, DigitalOcean (London), WooCommerce, Zoho Inventory & CRM, ShipStation v2, Xero
- Verification
- 3,240+ automated tests · Multi-pass security & logic audits · A+ SSL & security headers
The problem
Every order touches four systems, plus accounting.
Ultra Soft sells nearly 600 water softeners, filters, kits and spares online. Every order touches four separate systems (WooCommerce, Zoho Inventory, Zoho CRM and ShipStation) plus Xero for accounting. Off-the-shelf connectors and rigid low-code scripts couldn’t handle the operational reality.
- VAT rounding mismatches: WooCommerce rounds VAT per line item, while Zoho rounds VAT once per order (entity level), leaving orders a penny out and blocking automated invoicing.
- Mixed warehouse and dropship orders: a single basket often combines items held in Maidstone with items fulfilled directly by multiple external suppliers, each requiring separate purchase orders, tracking links and customer notifications.
- Silent third-party failures: dropped webhooks, unindexed search delays and rate limits caused standard integrations to either miss orders or create duplicate customers and shipments.
- No room for guesswork: linking the wrong kit variation or sending an unverified address costs real money in wrong dispatches and manual warehouse clean-up.
What we built
A strict, auditable state machine in place of fragile sync scripts.
Built with clean internal domain boundaries so the core order, stock and fulfilment engine owns the business logic, allowing individual third-party tools to be swapped or replaced over time without rewriting the pipeline.
01Zero-loss order intake and catch-up reconciliation
- Webhook and polling safety net
- Orders arrive via signed WooCommerce webhooks in seconds, backed by an automated 10-minute catch-up poller that recovers any order missed during site maintenance or cron stalls.
- Idempotency at the database layer
- Raw payloads are stored verbatim before processing, and database-level unique constraints guarantee that retried webhooks or overlapping jobs never create duplicate orders, customers or shipments.
02Penny-exact VAT and product matching
- Deterministic product ladder
- Matches website SKUs and variations to Zoho items and composite kits using verified product codes and human-approved links, never fuzzy name guesses.
- Entity-level VAT reconciliation
- Builds VAT-inclusive sales orders using Zoho’s VAT Override so every line, delivery charge and tax total matches what the customer paid to the penny. Any discrepancy is held automatically for review before confirmation.
03Split warehouse and dropship fulfilment
- Per-line routing
- Checks live stock and supplier rules across every order line, splitting mixed orders into warehouse shipments (sent to ShipStation v2) and per-supplier dropship purchase orders tracked in Zoho Inventory.
- Daily settle window
- Holds tracking updates until the end of the dispatch window so voided or reprinted labels never reach customers. Once settled, updates Zoho packages, writes tracking back to WooCommerce via a custom WordPress plugin, and triggers customer completion emails.
04Customer and CRM lifecycle sync
- Duplicate-safe customer resolution
- Matches buyers across Zoho CRM Contacts, Leads and Inventory without creating duplicate records, keeping each sales order’s delivery address isolated from the master CRM record.
- Automated marketing fields
- Updates lifecycle stage, consent basis, softener model and calculated next-replacement reminder dates directly on the CRM Contact after dispatch.
How we kept it safe
Safety enforced by the database and the code, not by convention.
- Database-enforced invariants
- PostgreSQL CHECK constraints prevent unready or held orders from ever holding a Zoho or ShipStation reference.
- Isolated staging and controlled live windows
- A separate staging instance runs against sandbox accounts, with code-enforced guards that block accidental cross-environment writes.
- Privacy and secret hygiene
- Customer PII is masked in operator views and stripped from application logs; credentials are rotated via stdin-piped tooling without touching shell history or server logs.
- 3,240+ fail-first tests
- Every edge case, from network timeouts and lost API replies to partial refunds and late label voids, is reproduced as a failing test before the fix ships.
Outcome
Orders that land once, correctly, with a person only where it matters.
- Eliminated manual order re-keying
- Across WooCommerce, Zoho Inventory, CRM and ShipStation.
- Zero duplicate shipments or penny-off invoices
- With clear “Needs attention” queues for the handful of edge cases that genuinely require a human decision.
- Full operational visibility
- Staff see every order’s seven-stage journey, from checkout to carrier tracking, on a single internal dashboard, backed by a complete audit trail and documented runbooks.
We also built Ultra Soft’s AI sales assistant, a separate system. Read the AI sales assistant case study →
Systems that need to agree with each other?
Tell us which systems are involved and where data gets stuck or retyped. Every integration we build is designed around the software you already use.
Discuss a project