Locations allow merchants to track product inventory across multiple physical or virtual locations. Locations also allow merchants to manage their store and warehouse physical addresses in a single source of truth, which can be used by tools such as store locator widgets or app integrations concerned with locations where a store’s business is conducted.
Default behavior: By default, Stencil’s native storefront and locations queries support stock levels from only the default location. If the default location runs out of stock, the product will be considered out of stock on the storefront, even if there is inventory in other locations.
Alternate behavior: By request, your store can instead use Aggregated stock, where stock from all locations is summed up for Stencil’s storefront and location queries. This means that if the default location has a stock of 0, but another location has a stock greater than 0, the product will still be considered in stock. If you would like to enable Aggregated stock, please contact our support team.
You can create up to the following number of locations:
You can disable, remove visibility, and delete locations.
The enabled and storefront_visibility flags for a location determine whether a location is available for Storefront and Management APIs.
enabled flag also controls:
storefront_visibility is set to false, the details of that location are omitted from the Storefront APIs.The Locations API allows you to manage locations. For examples, see Merchant Configuration under the End-to-end guides.
You can query locations using the GraphQL Storefront API. For examples, see Query Locations with the GraphQL Storefront API.
Due to the asynchronous nature of the Locations API, there may be a short delay before data is updated after the endpoints are called. Endpoints that manage these locations and inventory at these locations return a transaction_id for any write requests.
Manage location metafields using the Locations API.
To create a location metafield, send a request to the Create a location metafield endpoint. Each metafield must have a unique combination of key and value for a namespace.
Location metafields that have storefront access permissions (i.e. permission set as read_and_sf_access or write_and_sf_access) can be returned in the GraphQL Storefront API.
For example queries of this, see Query Locations with the GraphQL Storefront API.