VTEX changed how the availableQuantity
field works, which is returned by the API routes of the legacy search. This change may impact existing integrations.
Stores that use VTEX Intelligent Search are not affected.
What has changed?
The availableQuantity
field no longer represents the exact number of available items in the store inventory. The field now returns an estimate based on order of magnitude. The possible values for availableQuantity
are:
0
: 0 inventory quantity.1
: inventory quantity of 1.10
: inventory quantity between 2 and 10.100
: inventory quantity between 11 and 100.99999
: inventory quantity above 100.
This change affects all routes that return this field:
- Search for products
- Search for products with Filter, Order and Pagination
- Search product by product URL
- Search product offers
- Search SKU offers
- Get product search of who saw also saw (deprecated)
- Get product search of who saw also bought (deprecated)
- Get product search of who bought also bought (deprecated)
- Get product search of show together
- Get product search of accessories
- Get product search of similars
- Get product search of suggestions
Why did we make this change?
Previously, it was possible to check the product quantity in a store inventory through the legacy API. However, since inventory is a sensitive piece of data and the API is public, we decided to hide it.
What needs to be done?
If your store has any integration that returns the availableQuantity
field in any of the routes mentioned above, check the feature to take into account the new behavior.