Inventory location filters
Inventory location filters choose which Shopify locations count toward whether a merchant's products are in stock.
Location filters are only supported for Shopify merchants. Requests for merchants on other platforms return 400 Bad Request.
How locations affect stock
By default, stock at every Shopify location counts toward whether a product is available.
Adding locations narrows that: once at least one location is added, only the listed locations count and stock anywhere else is ignored. That is usually the intent when some locations are retail floors or returns holding rather than fulfillment.
Remove every location to go back to counting all of them.
The resource
The filter is a single list of Shopify location IDs on the inventory location filters resource:
PUT /merchants/{merchant_id}/inventory-location-filters{
"location_ids": ["12345678", "87654321"]
}The PUT replaces the full set. To disable filtering, pass an empty list. The response includes filtering_enabled, which is read-only and derived: it is true whenever at least one location ID is configured, and it is ignored on writes.
Location IDs must be numeric strings, and anything else is rejected. Beyond that, they are not checked against the merchant's Shopify account: an ID with a typo is stored but never matches anything, so it silently has no effect. Copy location IDs from Shopify rather than typing them.
One capability, one write path
Older configuration docs describe the same capability as the filter_inventory_by_locations platform feature flag plus shopify_config.enabled_location_ids. For Shopify merchants, that flag is now derived automatically from this resource: it turns on when location_ids is non-empty and off when the list is empty. Manage location filtering through this resource only, and do not set the flag or enabled_location_ids directly.
Related
Merchant Configuration Resources has the field table and read endpoint.
Last updated
Was this helpful?