Synchronising Inventory and Pricing Across Two Markets

A retailer sold in Hong Kong and Singapore from two systems that agreed with each other about once a day. Overselling was routine, and the reconciliation was a spreadsheet with a person attached to it.

Client withheld under NDA. The sector, the shape of the engagement and the constraints are described; no client data, screens, names or volumes are reproduced.

Snapshot
Client
Multi-market retailer, Hong Kong and Singapore
Sector
Retail, cross-border e-commerce
Engagement
Integration architecture, field ownership, migration
Scope
Stock ledger · price and tax rules · order routing · returns · reconciliation reports
Duration
18 weeks, run market by market
Status
Live in both markets, one ledger
2
markets, two storefronts, two currencies, one stock position.
18
fields that must agree between the systems, and an owner named for each.
0
manual reconciliations left. The spreadsheet was the deliverable to delete.
4
minutes from a sale in one market to stock reserved in the other.

Problem

Two systems, two teams, one warehouse. Each market kept its own stock figure and they exchanged numbers overnight, which meant that for most of the working day both storefronts were selling against a count that was already wrong.

The overnight sync also hid the cause of every error. When the numbers disagreed, the investigation started from a delta with no timestamps, and ended with a decision to trust one side. That decision was made weekly, by different people, in opposite directions.

Figure 1 — Two storefronts, one ledger, and the four things that must cross

Hong KongSingaporeStorefrontHKD, local deliveryReservationholds stock for 15 minReturnsrestocked locallyTaxno sales tax, GST on importStorefrontSGD, cross-border deliveryReservationholds stock for 15 minReturnsconsolidated weeklyTaxGST at point of saleone catalogueThe ledger is not copied between systems. It sits once, and both storefronts write to it through the same reservationcall, which is why there is nothing to reconcile.

Approach

The first decision was to stop syncing. A copy of the truth is the problem, not the fix: any sync interval is a window in which both sides are wrong. Stock became a single ledger with a reservation API, and both storefronts became clients of it.

The second decision was to write down which system owns which field. Eighteen fields, one owner each, and an explicit rule for what happens when the other side disagrees — which is that the owner wins and the disagreement is logged rather than merged. Most of the project was this list.

Figure 2 — Eighteen fields, two systems, one owner each

HK ownsSG ownsSharedNever syncedStock on handReservedPriceTax rateDelivery promiseReturn windowProduct copyledgerreservationlocallocalbase pricelocalrulerulepolicypolicytranslatedimages“Local” means each market sets its own and they are allowed to differ. “Never synced” is a decision, not an omission.

What the migration cost

Cutover was run one market at a time, over two weekends, with the old sync kept alive in read-only mode so the two could be compared for a fortnight. That fortnight found nine reservation bugs that would otherwise have been found by customers.

The unglamorous part was returns. A return in one market restocking a unit that was sold in the other is a tax event as well as a stock event, and the first version got the stock right and the tax wrong. It was fixed by making the ledger record the market of sale on every unit.

What we delivered

Ledger
One stock position
A single reservation service both storefronts call, replacing the nightly exchange.
Ownership
18 fields, 18 owners
A written rule per field, including the ones deliberately never synchronised.
Reservation
Four-minute propagation
A sale in one market reserves in the other inside the same transaction, not overnight.
Tax
Point-of-sale rules
GST at sale in Singapore, import handling in Hong Kong, decided per line rather than per order.
Returns
Market of sale recorded
Every unit carries where it was sold, so a cross-border return is a stock and a tax event at once.
Reporting
Reconciliation retired
The daily spreadsheet replaced by a disagreement log that should stay empty.

What it changed

Overselling stopped being a weekly event and became a monitored exception. The change was not accuracy in the sync; it was removing the sync, which removed the window in which both sides could be confidently wrong.

The field ownership table outlived the project. It is now the document new engineers are given in their first week, because it answers the question that used to take three meetings: which system is right about this.

CONTACT US

We provide a custom made service for just drop us a line.
We would be glad to have feedback from you.