{"section":"announcements","requestedLocale":"en","requestedSlug":"2024-09-18-change-to-the-availablequantity-field-in-the-search-api","locale":"en","slug":"2024-09-18-change-to-the-availablequantity-field-in-the-search-api","path":"docs/en/announcements/2024/september/2024-09-18-change-to-the-availablequantity-field-in-the-search-api.md","branch":"main","content":"VTEX changed how the `availableQuantity` field works, which is returned by the API routes of the legacy search. This change may impact existing integrations.\n\n> ℹ️ Stores that use VTEX Intelligent Search are not affected.\n\n## What has changed?\n\nThe `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:\n\n- `0`: 0 inventory quantity.\n- `1`: inventory quantity of 1.\n- `10`: inventory quantity between 2 and 10.\n- `100`: inventory quantity between 11 and 100.\n- `99999`: inventory quantity above 100.\n\nThis change affects all routes that return this field:\n\n- [Search for products](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search/-search-?endpoint=get-/api/catalog_system/pub/products/search/-search-) \n- [Search for products with Filter, Order and Pagination](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search?endpoint=get-/api/catalog_system/pub/products/search) \n- [Search product by product URL](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/search/-product-text-link-/p?endpoint=get-/api/catalog_system/pub/products/search/-product-text-link-/p) \n- [Search product offers](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/offers/-productId-?endpoint=get-/api/catalog_system/pub/products/offers/-productId-) \n- [Search SKU offers](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/offers/-productId-/sku/-skuId-?endpoint=get-/api/catalog_system/pub/products/offers/-productId-/sku/-skuId-) \n- [Get product search of who saw also saw (deprecated)](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/crossselling/whosawalsosaw/-productId-?endpoint=get-/api/catalog_system/pub/products/crossselling/whosawalsosaw/-productId-) \n- [Get product search of who saw also bought (deprecated)](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/crossselling/whosawalsobought/-productId-?endpoint=get-/api/catalog_system/pub/products/crossselling/whosawalsobought/-productId-) \n- [Get product search of who bought also bought (deprecated)](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/crossselling/whoboughtalsobought/-productId-?endpoint=get-/api/catalog_system/pub/products/crossselling/whoboughtalsobought/-productId-) \n- [Get product search of show together](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/crossselling/showtogether/-productId-?endpoint=get-/api/catalog_system/pub/products/crossselling/showtogether/-productId-) \n- [Get product search of accessories](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/crossselling/accessories/-productId-?endpoint=get-/api/catalog_system/pub/products/crossselling/accessories/-productId-) \n- [Get product search of similars](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/crossselling/similars/-productId-?endpoint=get-/api/catalog_system/pub/products/crossselling/similars/-productId-) \n- [Get product search of suggestions](https://developers.vtex.com/docs/api-reference/search-api#get-/api/catalog_system/pub/products/crossselling/suggestions/-productId-?endpoint=get-/api/catalog_system/pub/products/crossselling/suggestions/-productId-) \n\n## Why did we make this change?\n\nPreviously, 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.\n\n## What needs to be done?\n\nIf 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."}