Introduction
APIs in Developer Preview are subject to change and are not intended for use in production.
Send us your suggestions for improving this API. Your feedback is valuable to us.
This service allows you to query and modify the inventory for your store's products.
Terminology
- Item: a product from the catalog.
- Variant: a product variant. The inventory is managed per variant.
A variant can override the following values from the parent product:
- Price
- SKU
- Weight
- Inventory
Setup
To use the Inventory API, install the @wix/stores
package using npm or Yarn:
1npm install @wix/stores
or
1yarn add @wix/stores
Then import { inventory }
from @wix/stores
:
1import { inventory } from '@wix/stores'
Subtracts a set number of items from inventory.
The decrementInventory()
function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory.
Permission Scopes
For app development, you must have one of the following permission scopes:function decrementInventory(decrementData: Array<DecrementData>): Promise<void>
Item or product to decrement.
Gets inventory variant information based on the specified option choices.
The getInventoryVariants()
function returns a Promise that resolves to the specified inventory variant information.
Permission Scopes
For app development, you must have one of the following permission scopes:function getInventoryVariants(inventoryId: string, options: GetInventoryVariantsOptions): Promise<GetInventoryVariantsResponse>
Inventory item ID.
Adds a set number of items to inventory.
The incrementInventory()
function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory.
Permission Scopes
For app development, you must have one of the following permission scopes:function incrementInventory(incrementData: Array<IncrementData>): Promise<void>
Item or product to increment.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Returns a list of inventory items, given the provided paging, sorting and filtering.
Permission Scopes
For app development, you must have one of the following permission scopes:function queryInventory(options: QueryInventoryOptions): Promise<QueryInventoryResponse>
Updates product inventory, including total quantity, whether the product is in stock, and whether the product inventory is tracked.
The updateInventoryVariants()
function is a Promise that resolves to the updated inventory variant data.
Permission Scopes
For app development, you must have one of the following permission scopes:function updateInventoryVariants(productId: string, inventoryItem: UpdateInventoryVariantsInventoryItem): Promise<void>
Product ID.
Inventory item to update.