E-commerce and legacy logistics system integration
Retail (confidentiel)
A French retail player with around thirty physical stores wanted to launch e-commerce to respond to competitive pressure and evolving shopping habits. The strong constraint: refuse any modification to their internal logistics system, an AS400 in place for fifteen years that orchestrates the entire back office (inventory, store orders, supply, invoicing). This system is reliable, known by the teams, aligned with years of business rules and represents a considerable historical investment. Replacing it would have involved a multi-year project with high risks to operational continuity. The real topic was therefore not to modernize the IS but to make a modern e-commerce site coexist with an untouchable legacy, while guaranteeing reliable two-way stock and order synchronization from day one.
The AS400 system exposed no modern API and could not be modified. Data was accessible only through old proprietary interfaces and batch flat-file exports. We had to design an abstraction layer capable of reading legacy data while respecting its constraints, guaranteeing synchronization even during load peaks (launches, sales, marketing campaigns), and handling edge cases that always exist between e-commerce and physical logistics: unexpected stockouts between two reservations, product returns, inventory discrepancies, orders canceled at checkout. On top of that, a freshness constraint: a product displayed in stock on the site had to actually be in stock when the order was placed, without any awkward inconsistency window. Without a usable API on the legacy side, all the intelligence had to be carried by the integration layer.
We designed an intermediate API layer acting as a translator between the Next.js store and the AS400. This layer exposes modern REST endpoints on the store side and communicates with the legacy through its proprietary interfaces without ever modifying it. A RabbitMQ queue system absorbs peaks and guarantees no order is lost, even during temporary legacy overload. We implemented nightly reconciliation logic that compares both systems' states and alerts teams if an abnormal discrepancy appears. On the store side, an optimistic reservation system allows displaying real-time inventory while preventing double sales. Store returns are handled via a dedicated channel so that in-store cancellations automatically propagate to the site. Finally, the launch happened in stages: first a pilot category, then progressive extension to the full catalog, to detect any integration issues before they affected the entire business.