About the Inventory API

This service allows you to query and modify the inventory for your store's products.

(In the future, this service might be used to manage inventory for other things.)

Terminology

  • Item Represents a product from the catalog.
  • Variant A product variant. The inventory is managed per variant.
Was this helpful?
Yes
No

Using the Inventory API

Step 1 - Query product variants (Get Inventory Variants endpoint)

Copy Code
curl 'https://www.wixapis.com/stores/v2/inventoryItems/product/{productId}/getVariants' -H 'Content-Type: application/json' -H 'Authorization: XXX'

From the result, you can see whether inventory is being tracked for this product:

Copy Code
{
"inventoryItem": {
"id": "f8753103-0b3a-b24a-4931-50de280ac31a",
"externalId": "078acefc-f4c5-4db5-b6ce-af21d7f53ce5",
"productId": "078acefc-f4c5-4db5-b6ce-af21d7f53ce5",
"trackQuantity": true,
"variants": [
{
"variantId": "00000000-0000-0000-0000-000000000000",
"inStock": true,
"quantity": 4
}
],
"lastUpdated": "2020-08-31T20:05:40.348Z",
"numericId": "1598904314932014"
}
}

Step 2 - Update a specific variant of a product (Update Inventory Status endpoint)

Update whether the product inventory is tracked:

Copy Code
curl 'https://www.wixapis.com/stores/v2/inventoryItems/product/{productId}' -X PATCH --data-binary '{"inventoryItem": {"trackQuantity": false}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'

For a non-tracked product, you should update inStock:

Copy Code
curl 'https://www.wixapis.com/stores/v2/inventoryItems/product/{productId}' -X PATCH --data-binary '{"inventoryItem": {"trackQuantity": false,"variants": [{"variantId": "00000000-0000-0000-0000-000000000000","inStock": false}]}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'

For tracked products, you should update quantity:

Copy Code
curl 'https://www.wixapis.com/stores/v2/inventoryItems/product/{productId}' -X PATCH --data-binary '{"inventoryItem": {"trackQuantity": true,"variants": [{"variantId": "00000000-0000-0000-0000-000000000000","quantity": 4}]}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Was this helpful?
Yes
No

Inventory Object

Attributes
idstring
Inventory item ID.

externalIdstringRead-only
Deprecated: use productId.

productIdstringRead-only
Product ID.

trackQuantityboolean
Whether quantity is being tracked.

variantsArray <InventoryVariantV2>
Variants associated with this inventory item.

lastUpdatedstringRead-onlyformat date-time
Last updated timestamp.

numericIdnumberRead-only
Inventory’s unique numeric ID (assigned in ascending order). Primarily for sorting and filtering when crawling all inventories.

preorderInfoobject
Preorder information.
Was this helpful?
Yes
No

PostGet Inventory Variants

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Products
Read Products
Learn more about permission scopes.Authorization header required - pass the OAuth Access Token
Was this helpful?
Yes
No

PostQuery Inventory

Returns a list of up inventory items, given the provided paging, sorting and filtering. See Stores Pagination for more information.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Products
Read Products
Learn more about permission scopes.Authorization header required - pass the OAuth Access Token
Was this helpful?
Yes
No

PatchUpdate Inventory Variants

Updates product inventory, including total quantity, whether the product is in stock, and whether the product inventory is tracked.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Products
Learn more about permission scopes.Authorization header required - pass the OAuth Access Token

Syntax

PATCH
https://www.wixapis.com/stores/v2/inventoryItems/product/{inventoryItem.productId}

Was this helpful?
Yes
No

PostDecrement Inventory

Developer Preview - This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Subtracts a set number of items from inventory.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Products
Learn more about permission scopes.Authorization header required - pass the OAuth Access Token

Syntax

POST
https://www.wixapis.com/stores/v2/inventoryItems/decrement

Was this helpful?
Yes
No

PostIncrement Inventory

Developer Preview - This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Adds a set number of items to inventory.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Products
Learn more about permission scopes.Authorization header required - pass the OAuth Access Token

Syntax

POST
https://www.wixapis.com/stores/v2/inventoryItems/increment

Was this helpful?
Yes
No

Inventory Item Changed

Triggered when an inventory item is changed.

Permissions

WIX_STORES.READ_INVENTORY
Learn more about permissions.

Event Body

Event Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
inventoryItemIdstring
Inventory item ID.

externalIdstring
Deprecated: use productId.

productIdstring
Product ID.

trackInventoryboolean
Whether inventory is being tracked.

preorderInfoobject
Preorder information.

fieldMaskobject
Field mask of updated fields.
Was this helpful?
Yes
No

Inventory Variants Changed

Triggered when inventory variants are changed.

Permissions

WIX_STORES.READ_INVENTORY
Learn more about permissions.

Event Body

Event Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
inventoryItemIdstring
Inventory item ID.

externalIdstring
Deprecated: use productId.

productIdstring
Product ID.

variantsArray <ChangedInventoryVariant>
Information about changed variants.
Was this helpful?
Yes
No