This Shopify Flow is designed to automatically reconcile Shopify inventory when Amazon FBA fulfills orders through Marketplace Connect. When a new order is created, the Flow checks whether the customer display name equals “FBA Order” and whether the order has not already been processed, using a guard tag to ensure idempotency. It then iterates through each line item, confirms that the item has a valid SKU, and uses Shopify’s native inventoryAdjustQuantities Admin API mutation to reduce the available inventory at the dedicated Amazon location by the quantity Amazon fulfilled. This ensures Shopify’s inventory accurately reflects stock consumed by FBA, even though Marketplace Connect itself does not adjust inventory levels inside Shopify.
Marketplace Connect handles order creation, payment capture, fulfillment, and archival, but it does not modify Shopify inventory, which would otherwise drift over time. This Flow acts as the reconciliation layer between the two systems, ensuring that each FBA order reduces Shopify inventory exactly once, with every adjustment logged as an inventory correction for auditability. The process is fully automated, scoped only to new FBA orders, and does not touch historical data. As a result, Shopify remains the system of record for inventory accuracy while Amazon remains the system of record for fulfillment execution, without requiring manual intervention or external middleware.
