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
1
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
1
{
2
"inventoryItem": {
3
"id": "f8753103-0b3a-b24a-4931-50de280ac31a",
4
"externalId": "078acefc-f4c5-4db5-b6ce-af21d7f53ce5",
5
"productId": "078acefc-f4c5-4db5-b6ce-af21d7f53ce5",
6
"trackQuantity": true,
7
"variants": [
8
{
9
"variantId": "00000000-0000-0000-0000-000000000000",
10
"inStock": true,
11
"quantity": 4
12
}
13
],
14
"lastUpdated": "2020-08-31T20:05:40.348Z",
15
"numericId": "1598904314932014"
16
}
17
}

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

Update whether the product inventory is tracked:

Copy
1
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
1
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
1
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.
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.
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.
Endpoint
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.
Endpoint
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.
Endpoint
POST
https://www.wixapis.com/stores/v2/inventoryItems/increment

Was this helpful?
Yes
No

Inventory Item Changed

Triggered when an inventory item is changed.

Event BodyEvent 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.

Event BodyEvent 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