Hi,
We developing an app and need a practical way to calculate sellable inventory by destination - for example, how many units are actually available for Germany or for Europe.
This became an issue after online-store availability started depending on delivery profile configuration. Before that, we could usually take inventory from active online-fulfilling locations and calculate a reliable available quantity.
Now that is not always correct. A product can have stock in multiple locations, but only some of those locations may be allowed to ship to a given country or region through the delivery profile. So total available inventory is not necessarily the same as inventory sellable to that customer.
To calculate this correctly, an app needs to combine variant inventory, inventory locations, delivery profiles, delivery profile location groups, and the countries/zones assigned to those groups.
The problem is that this cannot be exported cleanly with Bulk Operations.The delivery profile structure requires nested paths for location groups, locations, and zones, and Bulk Operations rejects that query shape.
The required shape is roughly:
variant
-> deliveryProfile
-> profileLocationGroups
-> locationGroup
-> locations
-> locationGroupZones
-> zone
-> countries
A simplified version of the problematic query path:
deliveryProfile {
profileLocationGroups {
locationGroup {
locations(first: 250) {
edges {
node {
id
}
}
}
}
locationGroupZones(first: 250) {
edges {
node {
zone {
countries {
code {
countryCode
}
}
}
}
}
}
}
}
So right now the options are not great:
- Make a large number of paginated Admin GraphQL requests and join everything manually.
- Use a simpler inventory calculation that can be wrong for destination-specific availability.
What we need is either:
- Higher Bulk Operations nesting/path support for this delivery profile data, or
- A new bulk-friendly interface for destination-specific sellable inventory.
The main thing we need to answer at scale is simple:
How many units of this variant are sellable to this country or market?
Right now the data exists in Shopify, but there does not seem to be a scalable way to retrieve it for large catalogs.