Skip to content

Case study · Orderline

Orders, stock, and invoices in sync across commerce, warehouse, and ERP.

An integration layer connecting an online store, a B2B ordering portal, a marketplace, a third-party warehouse, and the ERP, so every order flows through without re-keying and every discrepancy is visible.

Sector
Wholesale & direct-to-consumer distribution
Scope
Integration audit to production
Core stack
TypeScript, Node.js, PostgreSQL, Message queues, REST APIs
Illustrative case study

This case study shows how we would approach a representative project of this kind. It is not a record of a specific client engagement: names, interfaces, and plans are examples, and outcomes are described as what would be measured rather than as results.

orderline / integration-monitorOrderlineIntegration monitor6 FLOWS RUNNING · 1 RETRYINGLast 24 hoursCHANNELSINTEGRATION LAYERSYSTEMS OF RECORDOnline storeORDERS · 12S AGOB2B portalORDERS · 40S AGOMarketplaceSTOCK · 3S AGOERPSYSTEM OF RECORDWarehouse (3PL)RETRYING · 2 OF 5PaymentsINVOICES · 1M AGOIntegration serviceCONNECTORS6 activeEVENTS / MIN42QUEUE DEPTH3DEAD-LETTER1Recent eventsAllFailedRetryingTIMEEVENTROUTESTATUS10:42:18order.createdStore → ERPSynced10:42:18stock.updatedERP → MarketplaceSynced10:42:11shipment.created3PL → ERPSynced10:41:56order.createdB2B → ERPSynced10:41:40order.releasedERP → 3PLRetrying 2/510:41:02invoice.postedERP → PaymentsSynced10:39:27return.received3PL → ERPFailed · queuedDaily reconciliation13 OCT · 02:00Orders1,284 / 1,284Shipments1,190 / 1,190Invoices1,271 / 1,2732 DIFFERENCES REPORTED TO FINANCEFailed messagereturn.received · R-30418ERP rejected unknown reason code “RX9”Inspect payloadReplay after fix

Scroll sideways to see the full screen

Interface conceptIntegration monitor concept: connected systems, recent events, and daily reconciliation.

§ 01The situation

Where things stand.

A distributor sells through its own online store, a B2B portal for trade customers, and a marketplace, and ships from a third-party logistics warehouse. The ERP is the system of record for products, stock, customers, and invoices.

Today the systems are connected by a patchwork of plug-ins, CSV exports, and manual steps. Stock levels drift, orders occasionally ship twice or not at all, and month-end reconciliation takes days.

What makes it hard

  • Overselling

    Stock updates reach the sales channels late, so popular items are sold after they have run out.

  • Silent failures

    When a plug-in fails, nobody knows until a customer asks about an order that never shipped.

  • Duplicate records

    Retries and manual fixes create duplicate orders and customers in the ERP.

  • Month-end reconciliation

    Finance compares exports from four systems by hand to find missing invoices and payments.

§ 02The solution

What we would build.

Each part answers one of the problems above, and each can be delivered and tested on its own.

A single integration layer
A dedicated service replaces point-to-point plug-ins, giving every data flow one place where it is defined, logged, and monitored.
Event-driven order flow
Orders, shipments, and returns are published as events and processed in order, with idempotent writes so a retry never creates a duplicate.
Stock synchronization
Available stock is calculated from ERP and warehouse data and pushed to every channel within seconds of a change.
Field ownership
Each field has one owning system, documented and enforced, so updates stop overwriting each other.
Failure handling
Failed messages are queued with their error, alerted on, and replayed once the cause is fixed.
Automated reconciliation
Orders, shipments, and invoices are compared across systems every day, with differences reported to the team.

§ 03Architecture

How the pieces fit.

A layered view of the proposed system. The highlighted component carries the logic the rest of the system depends on, so it is designed and tested first.

  1. 01 Channels

    • Online store
    • B2B portal
    • Marketplace
  2. 02 Integration layer

    • Connectors
    • Event bus & queues
    • Mapping & transformation
    • Retries & dead-letter queue
  3. 03 Systems of record

    • ERP
    • Warehouse (3PL)
    • Payment provider
  4. 04 Operations

    • Integration monitor
    • Reconciliation reports
    • Alerting
Architecture overviewOrderline, by layer. Core technologies: TypeScript, Node.js, PostgreSQL, Message queues, REST APIs, AWS, Docker.

§ 04Delivery plan

Delivered in stages you can review.

Each stage ends with something working that you can evaluate before committing to the next.

  1. Stage 01

    3 weeks

    Integration audit

    Map every data flow, owner, and current failure; agree the target architecture and field ownership.

  2. Stage 02

    6 weeks

    Foundation

    Integration service, monitoring, and the order flow from the online store to the ERP and warehouse.

  3. Stage 03

    6 weeks

    Channels & stock

    B2B portal and marketplace connectors, near-real-time stock synchronization, and returns.

  4. Stage 04

    4 weeks

    Reconciliation & handover

    Automated reconciliation, runbooks, and retirement of the old plug-ins.

§ 05Outcomes

What you receive, and how success is measured.

Targets for each measure are agreed during discovery, using your current figures as the baseline, and reported on throughout delivery.

Deliverables

  • Integration service with a connector for each system
  • Integration monitor with replay of failed messages
  • Field ownership and data flow documentation
  • Automated daily reconciliation reports
  • Runbooks for common failures

Measured by

  • Orders that need manual intervention
  • Time for a stock change to reach every channel
  • Unresolved reconciliation differences at month end
  • Time to detect and resolve a failed sync

§ 06Start a project

Planning something similar?

Describe where things stand today and what needs to change. We will reply with questions and an initial view of scope and approach.

  1. 01

    Share the context

    A short description of the project, your goals, and any constraints you already know about.

  2. 02

    We review it

    We read it carefully and reply with questions or an initial perspective on the problem.

  3. 03

    A first conversation

    A call to explore scope, approach, and whether we are the right fit for the work.