less ~/notes/bidirectional-erp-sync.md

Two systems, one truth: bidirectional sync with an external ERP

16 Jul 2026· 1 min read
Node.jsERPE-commerce

The client ran products, stock and pricing on an ERP their staff already used daily. They wanted an app, a storefront and an operations dashboard. Replacing the ERP was never sensible, and duplicating its data would create two versions of the truth that disagree by the end of the first week.

The rule that makes bidirectional sync survivable is that every entity has exactly one authoritative side. The ERP owns catalogue, stock and price. The platform owns customers, carts, orders and fulfilment. Nothing is authoritative in both directions, because that is not sync, it is a conflict engine.

The harder half was not code. The integration contract had to be agreed with the ERP vendor engineering team, who were in another country and had their own roadmap. That meant working out what their system expected on each side of the exchange, specifying what they needed to build to meet ours, and keeping both sides moving to it across a time zone gap.

Which is why nine written guides ship with that codebase, including dedicated integration documentation. A two-system contract that exists only in one engineer memory is a liability, and the engineer in question was me.