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.
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.
Both operations work with the same item
object, which includes catalog references, quantities, location information, and subscription details.
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.
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.
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.
It's important to note the following points before starting to code:
- You can configure your inventory update preference with the Orders Settings API:
- 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.
- 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.