About the Inventory Items API

The Inventory Items API allows you to manage inventory for products 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.

Before you begin

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

  • The Wix user must install the Wix Stores app.
  • Inventory items aren't automatically created when you create a product. Use Create Product With Inventory 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.

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

Terminology

For a comprehensive glossary of Catalog V3 terms, see Terminology.

Did this help?