> 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/e-commerce/catalogs/inventory-service-plugin/introduction.md

## Article Content:

# About the Inventory Service Plugin

The Inventory Service Plugin enables any business vertical or catalog implementor to integrate with a unified inventory system. It supports inventory business logic without requiring implementors to acquire deep knowledge of purchase or post-purchase events. It keeps inventory in sync with order flows and prevents orders for unavailable items—whether physical, digital, or time-based.

The integration is done via an app in the Wix App Market (created in the Wix Studio workspace), and the Wix Inventory service plugin.

Learn more about [implementing a service plugin with Wix](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/service-plugins/about-service-plugin-extensions.md).

With the Inventory Service Plugin, you can:
+ Decrement availability when items are ordered, paid for, or allocated.
+ Increment availability when orders are canceled, refunded, or edited.
+ Manage inventory across multiple locations.
+ Handle both regular and subscription items.
+ Control inventory validation behavior for different order flows.

## Use cases

+ [Decrement inventory as part of order placed flow](https://dev.wix.com/docs/rest/business-solutions/e-commerce/catalogs/inventory-service-plugin/sample-flows.md)
+ [Update inventory as part of order edit flow](https://dev.wix.com/docs/rest/business-solutions/e-commerce/catalogs/inventory-service-plugin/sample-flows.md)

Both operations work with the same `item` object, which includes catalog references, quantities, location information, and subscription details.

## Key service plugin behavior

### Inventory validation control

The `restrictInventoryValue` parameter in decrement requests controls critical validation behavior:

+ **When `true`**: The operation validates available stock and fails if decrementing would result in negative inventory.
+ **When `false`**: The operation proceeds regardless of current stock levels, allowing negative inventory.

This distinction is crucial for different order flows - strict validation for customer-initiated orders versus flexible handling for merchant-initiated changes.

### Location-based inventory

Inventory can be managed per location using the optional `locationId` field:

+ **When provided**: Inventory changes apply to the specific location.
+ **When omitted**: Changes apply to the default location.

### Quantity limits

The service plugin has different quantity limits for operations:

+ **Decrement operations**: Support up to 300 items per request.
+ **Increment operations**: Support up to 300 items per request.

## Before you begin

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

+ You can configure your inventory update preference with the [Orders Settings API](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/orders-settings/introduction.md):
  + **Order placed (default)**: This will fail the order creation if items aren't available.
  + **Order paid**: An order will always be created and inventory will update upon successful payment. If items are no longer available at that moment, the merchant will be responsible for resolving the issue.
+ Your service must handle both increment and decrement operations.

## Terminology

+ **Inventory integration**: A 3rd-party app that implements custom logic to manage inventory.
+ **Inventory item**: Identify an item with quantity in the inventory system that needs to be updated.
+ **Catalog reference**: The unique identifier of an item in the platform managed by the catalog owner.
+ **Subscription item**: Describes if the current item is part of a recurring subscription. Inventory systems can decide to handle those items differently.
+ **Restrict inventory**: A flag passed on the decrement API. When set to true, the implementer should fail the request if inventory is not available.