Syncing marketplace inventory into an ERP looks like a simple diff. It is not. Amazon runs its own state machine, and your ERP changes only when someone posts a document. Here is a pipeline design that survives that mismatch.
What is the core problem?
Amazon reports several quantity buckets per product: available, reserved, inbound, in transit and unfulfillable. The ERP holds one number per item per warehouse. Compare only the “available” bucket and you generate corrections that are wrong.
Why split detection from action?
Stage 1 is read-only. It pulls the Amazon snapshot, resolves each listing to an ERP item and emits a diff. Stage 2 consumes that diff and writes. The split gives you a reviewable artifact between decision and mutation, safe reruns of stage 1, and a clean place to halt.
How should you key the join?
Use the marketplace product identifier stored on the ERP item, not the seller SKU. SKUs get renamed and duplicated. Identifiers stay constant. Unmatched rows should fail loudly, with the quantity at stake attached, instead of dropping silently.
How should the writes work?
Never patch a stock field. Post documents. In SAP Business One, that means a Goods Receipt when Amazon holds more and a Goods Issue when the ERP holds more. Each carries the item, quantity, warehouse and a reason reference. Run corrections in both directions, or the ERP figure inflates over time.
What should you persist?
Store every snapshot with a timestamp. You get a time series for debugging drift, which neither Amazon nor the ERP keeps for you. Also dedicate one ERP warehouse to FBA stock so the comparison has a single, unambiguous target.
Where does this exist as a product?
This is the pattern behind the Amazon FBA to SAP Business One workflow in appse ai, the AI workflow automation platform from APPSeCONNECT. The design matters more than the tool: detect, review, post documents, keep history.
Top comments (0)