{"product_id":"n8n-webhook-workflow-sync-multi-location-inventory-to-medusa","title":"n8n Webhook Workflow: Sync Multi-Location Inventory to Medusa","description":"\u003ch3\u003eSync multi-location inventory to Medusa—automatically via a Webhook\u003c\/h3\u003e\n\u003cp\u003eThis n8n Webhook Workflow receives a stock feed with \u003cstrong\u003eSKUs and quantities per \u003cem\u003estock_location_id\u003c\/em\u003e\u003c\/strong\u003e, validates and normalizes the payload, then \u003cstrong\u003esynchronizes absolute inventory levels in Medusa\u003c\/strong\u003e by matching inventory items by SKU. It also returns a clear JSON report of what was synced and what was missing.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives stock updates\u003c\/strong\u003e through a \u003ccode\u003ePOST\u003c\/code\u003e webhook request containing \u003ccode\u003estock_location_id\u003c\/code\u003e and an \u003ccode\u003eitems\u003c\/code\u003e array (each with \u003ccode\u003esku\u003c\/code\u003e and \u003ccode\u003estocked_quantity\u003c\/code\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eValidates and normalizes data\u003c\/strong\u003e by converting each incoming item into a consistent row format: \u003ccode\u003esku\u003c\/code\u003e, \u003ccode\u003estocked_quantity\u003c\/code\u003e, and \u003ccode\u003estock_location_id\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMatches SKUs in Medusa\u003c\/strong\u003e by querying Medusa for an inventory item whose SKU matches the row.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUpdates per-location inventory\u003c\/strong\u003e: if a matching Medusa inventory item exists, the workflow sets the \u003cstrong\u003eabsolute inventory level\u003c\/strong\u003e for that item at the provided \u003ccode\u003estock_location_id\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReports missing SKUs\u003c\/strong\u003e: if no matching Medusa inventory item is found, it records a \u003ccode\u003enot_found\u003c\/code\u003e result and \u003cstrong\u003edoes not create new inventory records\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eResponds with a sync report\u003c\/strong\u003e: returns HTTP \u003cstrong\u003e200\u003c\/strong\u003e when all items sync, or HTTP \u003cstrong\u003e207\u003c\/strong\u003e when some SKUs are missing—along with an aggregated JSON sync report.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eKeep \u003cstrong\u003eMedusa inventory\u003c\/strong\u003e updated from a WMS\/ERP that sends SKU quantities per store\/warehouse location.\u003c\/li\u003e\n  \u003cli\u003eRun reliable \u003cstrong\u003emulti-location stock synchronization\u003c\/strong\u003e whenever a purchase, shipment, or stock adjustment occurs.\u003c\/li\u003e\n  \u003cli\u003eAutomate inventory updates while getting actionable feedback when SKUs are missing in Medusa.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n Webhook\u003c\/strong\u003e (webhook endpoint for \u003cem\u003emedusa-inventory-sync\u003c\/em\u003e)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMedusa integration\u003c\/strong\u003e via Medusa backend URL and an API token\/secret\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNodes used\u003c\/strong\u003e: if, set, code, merge, webhook, sticky note\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eSetup note:\u003c\/strong\u003e Configure your Medusa credentials in n8n, use the production webhook URL, and ensure the target Medusa store already contains inventory items for every SKU you plan to send.\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45889868267699,"sku":"N8N-18599","price":30.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/WqUt9kvAnl5PBxOZqeOhX_dt160JrH.png?v=1787498814","url":"https:\/\/buyflowscripts.com\/products\/n8n-webhook-workflow-sync-multi-location-inventory-to-medusa","provider":"N8N Commerce","version":"1.0","type":"link"}