> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/inventory-items-v3/introduction.md

## Article Content:

# About the Inventory Items API

The Inventory Items API allows you to manage inventory for [products](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/introduction.md) in Wix Stores. An inventory item tracks the stock for a specific product variant at a specific location.

With the Inventory Items API, you can:
- Create and manage inventory items for product variants.
- Track stock levels and availability across multiple locations.
- Increment and decrement inventory quantities.
- Enable and configure preorder settings.

For a comprehensive guide to inventory concepts including tracking methods, availability status, preorder configuration, and multi-location management, see [About Inventory Management](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/about-inventory-management.md).

## Before you begin

It's important to note the following points before starting to code:

- The Wix user must install the [Wix Stores app](https://www.wix.com/app-market/wix-stores).
- Inventory items aren't automatically created when you create a product. Use [Create Product With Inventory](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/products-v3/create-product-with-inventory.md) to create both in a single call, or create inventory items separately using this API.

## Inventory items and locations

Each inventory item represents a specific variant at a specific location. The combination of `variantId` and `locationId` is unique—you can't have two inventory items for the same variant at the same location.

When working with multi-location inventory (where a product's variants are tracked across multiple physical locations like stores or warehouses), be aware that the product's read-only `inventory` field reflects only the default location's inventory status.

### Inventory deduction and checkout

When customers place orders on a Wix Store, inventory automatically deducts from the default location. If you need to deduct stock from specific non-default locations, you can't use Wix's standard checkout functionality. This applies to multi-location inventory scenarios, offline purchases, and POS transactions.

For more details on how inventory deduction works, see [Online Store Product Purchase Flow](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/online-store-product-purchase-flow.md).

## Tracking methods

Inventory can be tracked using either quantity tracking or in-stock tracking. The `trackQuantity` field indicates which method is being used and is automatically set based on how you configure the item.

### Quantity tracking

To use this tracking method, set the `quantity` field to the number of items available. Use this when you need exact stock counts. Quantity can be negative when inventory is decremented for paid orders. This method supports preorder limits.

### In-stock tracking

To use this tracking method, set `inStock` to `true` for available items or `false` for unavailable. Use this for made-to-order products or digital products with unlimited inventory. Preorder limits aren't supported with this method.

## Preorder

Preorder settings are configured per inventory item, meaning each variant-location combination can have its own preorder configuration.

When preorder is enabled for an inventory item:
- The item's `availabilityStatus` becomes `PREORDER` when stock reaches zero
- You can set a limit on how many items can be preordered
- You can display a custom message to customers

### Preorder restrictions

- Preorder can't be enabled for digital products
- Preorder can't be enabled for products with subscriptions
- Preorder limits are only supported for quantity-tracked inventory

> **Note:** The product entity's `inventory.preorderStatus` and `inventory.preorderAvailability` fields reflect the preorder state of the default location only.

## Use cases
- [Create inventory items in a specific location](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/inventory-items-v3/sample-use-cases-and-flows.md#create-inventory-items-in-a-specific-location)
- [Increment inventory of a variant](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/inventory-items-v3/sample-use-cases-and-flows.md#increment-inventory-of-a-variant)
- [Change the tracking method for a product](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/inventory-items-v3/sample-use-cases-and-flows.md#change-the-tracking-method-for-a-product)
- [Find in-stock products at a specific location](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/inventory-items-v3/sample-use-cases-and-flows.md#find-in-stock-products-at-a-specific-location)

## Terminology

For a comprehensive glossary of Catalog V3 terms, see [Terminology](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/terminology.md).

## SDK Setup
  `@wix/stores`

To use the API, install the `@wix/stores` package.

#### Install the package

Follow the installation instructions for your development environment.

| Development environment | Installation method |
|--|--|
| Wix sites (editor or IDE) | Use the [package manager](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-in-the-editor.md). |
| Wix sites (local IDE) | Run `wix install @wix/stores` using the [Wix CLI](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-with-the-wix-cli.md).|
| Blocks apps | Use the same installation method as Wix sites. |
| CLI and self-hosted apps | Run `npm install @wix/stores` or `yarn add @wix/stores`. |
| Headless sites and apps | Run `npm install @wix/stores` or `yarn add @wix/stores`. |

#### Import the package

To import the package in your code:

```js
import { inventoryItemsV3 } from '@wix/stores'
```

#### Import types

Types for this API are accessed through the `inventoryItemsV3` namespace you already imported above, as `inventoryItemsV3.<TypeName>`, using any type name shown in these docs.
  