> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Locations

*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.

## Managing locations

You can create up to the following number of locations:

* Core plan: up to 4
* Growth plan: up to 5
* Scale plan: up to 8
* Performance plan: 100; can be customized by request

You can disable, remove visibility, and [delete locations](/developer/api-reference/rest/admin/management/inventory/locations/delete-locations).

The `enabled` and `storefront_visibility` flags for a location determine whether a location is available for Storefront and Management APIs.

* Both flags determine if a location will return through any of the Storefront APIs, including getting available pickup methods. The flags control location visibility through the Storefront APIs.
* However, the `enabled` flag also controls:
  * Whether a location can be used to create orders and pickup methods.
  * Whether you can edit stock levels through the management APIs
  * If any stock for products at a location contribute to the "available to sell" total returned by the Storefront APIs.
* For example, a location can be "enabled", allowing orders to be fulfilled at that location through the Order V2 or Checkout APIs. If its `storefront_visibility` is set to false, the details of that location are omitted from the Storefront APIs.

The [Locations API](/developer/api-reference/rest/admin/management/inventory/locations) allows you to manage locations. For examples, see [Merchant Configuration](/developer/docs/integrations/platform-solutions/buy-online-pick-up-in-store/end-to-end-guide/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](/developer/docs/storefront/guides/graphql-storefront-api/locations/queries).

> **Note**
>
> 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 create or update these locations and inventory at these locations return a `transaction_id`. Delete requests return `204 No Content`.

### Location metafields

Manage location metafields using the [Locations API](/developer/api-reference/rest/admin/management/inventory/locations).

To create a location metafield, send a request to the [Create a location metafield](/developer/api-reference/rest/admin/management/inventory/locations/metafields/create-location-metafield) endpoint. Each metafield must have a unique combination of `key` and `value` for a `namespace`.

#### Request

**`Example request: Create a location metafield`**

```http title="Example request: Create a location metafield"
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/inventory/locations/{{LOCATION_ID}}/metafields
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

{
  "key": "location status",
  "value": "upcoming",
  "namespace": "headquarters",
  "permission_set": "write_and_sf_access",
  "description": "new location"
}
```

#### Response

**`Example response: Create a location metafield`**

```json title="Example response: Create a location metafield"
{
  "data": {
      "id": 4,
      "key": "location status",
      "value": "upcoming",
      "namespace": "headquarters",
      "permission_set": "write_and_sf_access",
      "resource_type": "location",
      "resource_id": 1,
      "description": "new location",
      "date_created": "2023-03-16T15:14:47+00:00",
      "date_modified": "2023-03-16T15:14:47+00:00"
},
  "meta": {}
}
```

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](/developer/docs/storefront/guides/graphql-storefront-api/locations/queries).

## Resources

* [Locations API Reference](/developer/api-reference/rest/admin/management/inventory/locations)

  * [Create Locations](/developer/api-reference/rest/admin/management/inventory/locations/create-locations)

  * [Update Locations](/developer/api-reference/rest/admin/management/inventory/locations/update-locations)

  * [Get Locations](/developer/api-reference/rest/admin/management/inventory/locations/get-locations)

  * [Delete locations](/developer/api-reference/rest/admin/management/inventory/locations/delete-locations)

  * [Create a location metafield](/developer/api-reference/rest/admin/management/inventory/locations/metafields/create-location-metafield)

  * [Update a location metafield](/developer/api-reference/rest/admin/management/inventory/locations/metafields/update-location-metafield)

  * [Get a location metafield](/developer/api-reference/rest/admin/management/inventory/locations/metafields/get-location-metafield)

  * [Get location metafields](/developer/api-reference/rest/admin/management/inventory/locations/metafields/get-location-metafields)

  * [Delete a location metafield](/developer/api-reference/rest/admin/management/inventory/locations/metafields/delete-location-metafield)

* [Get Locations](/developer/docs/storefront/guides/graphql-storefront-api/locations/settings)
  * [Query Locations with the GraphQL Storefront API](/developer/docs/storefront/guides/graphql-storefront-api/locations/queries)