We checked the locations query, but we’re not sure if we’ve been able to get the best way to achieve this.
What’s the most efficient way to obtain all the locations of a SKU that have on hand inventory for a specific customer account?
We tried using the locations query, but we can’t get neither the customer account id filter nor the on hand value filter.
We also tried the warehouse products query, but a location subquery must be used to get all the locations, and then filter over that result to get the locations with inventory values.
Is there any more direct way to obtain the locations with inventory values for a SKU of a specific customer id?
Thanks for the info! It’s similar to what we’re doing (our difference is that we filter the customer account id in the warehouse products query rather than in the locations query).
Yes, our issue is that we may have products with many empty locations that can make the query more expensive.
If we paginate over the results, we can control the costs but this makes the “total query” slower.
I assume that filtering by quantity > 0 before is not possible, right?
At the moment I believe that is the best that can be done. I will go ahead and pass along your feedback regarding the filters in the locations query. I also think a functionality like that would be super helpful.
Let me know if there’s anything I can do to assist here.