What is the best way to get the inventory levels for multiple products?
I can use the mutation inventoryItems to get all products in a store (25,000), but what if I just want to get say 1000 of them. I can query them individually, but is there a more efficient way, like an array of say 100 that I could then batch up
Unfortunately not. They will be a list of skus where stock has changed. From that I will then get the inventory level, either directly or from its inventory ID that I have stored
I have see this sort of thing: #https://community.shopify.com/c/Shopify-APIs-SDKs/Graphql-query-help-get-stock-for-1-SKU-for-1-locat...
But really wanted something where I could pass in an array of values or something
If you subscribe to the product variant's inventory level changed webhook then you can act off those as they occur. Of course your triggered API requests would be serially made, but then again they would be closer to real-time than trying to batch an array of items based on stock levels changing. Does this make sense?
Interesting. So that would tell me what has changed, I could then act on that.
Probably wont help me here though as I need to base my changes on what has changed in our global stock file. For example for a sku we sell 100 products through a different channel, I then need to update that product inventory level (which may not have been sold through the website)