{"section":"announcements","requestedLocale":"pt","requestedSlug":"2024-09-18-alteracao-no-campo-availablequantity-da-api-de-busca","locale":"pt","slug":"2024-09-18-alteracao-no-campo-availablequantity-da-api-de-busca","path":"docs/pt/announcements/2024/setembro/2024-09-18-alteracao-no-campo-availablequantity-da-api-de-busca.md","branch":"main","content":"A VTEX alterou o funcionamento do campo `availableQuantity`, retornado pelas rotas da API de busca legada. Esta alteração pode impactar no funcionamento de integrações existentes.\n\n> ℹ️ Lojas que utilizam o VTEX Intelligent Search não serão afetadas.\n\n## O que mudou?\n\nO campo `availableQuantity` não corresponde mais à quantidade exata de itens disponíveis no inventário da sua loja. Agora, este campo retorna uma aproximação por ordem de grandeza. Confira abaixo os valores possíveis para o campo `availableQuantity`:\n\n- `0`: 0 unidades no inventário.\n- `1`: 1 unidade no inventário.\n- `10`: entre 2 e 10 unidades no inventário.\n- `100`: entre 11 e 100 unidades no inventário.\n- `99999`: mais de 100 unidades no inventário.\n\nEsta mudança afeta todas as rotas que retornam este campo:\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## Por que fizemos esta mudança?\n\nAntes, era possível ver a quantidade do produto em estoque de uma loja a partir da API da busca legada. Porém, como o inventário é um dado sensível e a API é pública, decidimos ocultar essa informação.\n\n## O que precisa ser feito?\n\nSe a sua loja possui alguma integração que use o campo `availableQuantity` retornado por uma das rotas citadas acima, reavalie a funcionalidade considerando o novo comportamento do campo."}