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

# Get Inventory

You can query inventory information using the GraphQL Storefront API. The information accessible by any storefront API is controlled by the [inventory settings](#inventory-settings) for the store.

For example queries, see [Query Inventory with the GraphQL Storefront API](/developer/docs/storefront/guides/graphql-storefront-api/inventory/queries).

To work with inventory settings, the [API account](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts) that generates [Storefront tokens](/developer/api-reference/rest/admin/authentication-apis/storefront-api-tokens) must include one of the following [OAuth scopes](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes):

| UI Name  | Permission | Parameter                     |
| :------- | :--------- | :---------------------------- |
| Products | modify     | `store_v2_products`           |
| Products | read-only  | `store_v2_products_read_only` |

Use these scopes to read and change the following information:

* The total inventory quantity of a particular product or variant that is available for shoppers across all visible locations
* The inventory quantity of a particular variant that is available at a specified location

## Settings to retrieve inventories

### Inventory Settings

Regardless of physical stock levels, inventory quantities may return `null` depending on the store's inventory settings, accessible through the [Settings API](/developer/api-reference/rest/admin/management/inventory) or the **Settings** > **Inventory** page in the store control panel.

In the following cases, inventory-related storefront queries may return different responses than expected:

| Case                                                 | Response                                                                                              |
| :--------------------------------------------------- | :---------------------------------------------------------------------------------------------------- |
| Out-of-stock products are hidden from the storefront | No responses will contain that product                                                                |
| Stock levels are hidden from the storefront          | Inventory levels will always return `null`                                                            |
| Only products low in stock display inventory levels  | Inventory levels for products with quantities above the low-stock threshold will always return `null` |

A store's inventory settings also affect inventory levels for variants. To see examples of these responses, see [Query Inventory with the GraphQL Storefront API](/developer/docs/storefront/guides/graphql-storefront-api/inventory/queries).

### Location settings

* When a location is *enabled*, its inventory of products and variants is accessible to the storefront. This inventory is included in the aggregate stock for a product or variant.
* If a location is *enabled* and *visible*, its inventory is fetched when you query the stock for a variant at each location.

To enable locations and change location visibility, use the [Update locations](/developer/api-reference/rest/admin/management/inventory/locations/update-locations) endpoint.

## Resources

* [GraphQL Storefront API Overview](/developer/docs/storefront/guides/graphql-storefront-api)
* [GraphQL Storefront API Reference](/developer/docs/storefront/guides/graphql-storefront-api)
* [GraphQL Storefront Playground](/developer/api-reference/rest/storefront/overview)
* [GraphQL Storefront Explorer](/developer/api-reference/rest/storefront/overview)