It looks like there’s a lack of documentation around the fetch_stock webhook that is called when the inventoryManagement flag is used when creating fulfillment services.
I’d like details about the request url params / body used when the fetch_stock webhook is called.
I’m particularly interested in how requests distinguish between different app locations that are added by an app, such as for different warehouse locations orders may be fulfilled from dotted around the country / across different countries.
For example, the app registers the following fulfillment service (locations):
Which appear as corresponding app locations under Shopify location settings:
All the hints from conversations I’ve found so far suggest that Shopify makes a call to the fetch_stock webhook, detailing the shop it’s interested in and the SKU(s) to return quantities for. But how are multiple location scenarios handled?
Hi @gavinharriss
You’re right that the docs on the fetch_stock endpoint don’t explicitly describe how the requests operate when there are multiple locations. I’m digging into this more on my side but in the meantime, are you seeing location_id included in the request?
Thanks @Liam-Shopify, I must admit that I haven’t tried hooking up the webhook yet to experiment. I’m initially info gathering to see if it’s worth trying to hook things up / look for potential blockers before throwing time at coding the feature in to the fulfillment app.
Finally found some time to experiment and can confirm the location_id is in the url e.g.
/webhooks/fetch_stock.json?location_id=12330433081&max_retries=3&shop=quickstart-redacted.myshopify.com&sku=TEST-003×tamp=1756784782
and from info found elsewhere on the web, it may be possible for Shopify to request multiple skus in a single call? [ref with broken doc link]
/webhooks/fetch_stock.json?location_id=12330433081&max_retries=3&shop=quickstart-redacted.myshopify.com&sku=TEST-001&sku=TEST-002&sku=TEST-003×tamp=1756784782
or possible request all inventory by not providing any skus? [ref with broken doc link]
/webhooks/fetch_stock.json?location_id=12330433081&max_retries=3&shop=quickstart-redacted.myshopify.com×tamp=1756784782
I’ll monitor the logs and see what comes in from Shopify.