3

I am using product search REST API for listing the products based on the category. Here is my search criteria V1/products?searchCriteria[filterGroups][0][filters][0][field]=category_id& searchCriteria[filterGroups][0][filters][0][value]=4&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[filterGroups][1][filters][0][field]=status& searchCriteria[filterGroups][1][filters][0][value]=1&searchCriteria[filterGroups][1][filters][0][conditionType]=eq&searchCriteria[filterGroups][2][filters][0][field]=visibility&searchCriteria[filterGroups][2][filters][0][value]=4&searchCriteria[filterGroups][2][filters][0][conditionType]=eq&searchCriteria[pageSize]=10& searchCriteria[currentPage]=1

I am getting the response but in which 'out of stock' products also coming. I need only 'in stock' products. Since it is not an attribute I can't directly filter the collection. Is there any other way to get the response as per my need?

1
  • Try searchCriteria[filter_groups] not searchCriteria[filterGroups] – Moe Hammadi Dec 27 '17 at 10:37
0
 /rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=category_id&searchCriteria[filterGroups][0][filters][0][value]=4,7&searchCriteria[filterGroups][1][filters][0][field]=status&searchCriteria[filterGroups][1][filters][0][value]=2&searchCriteria[current_page]=1&searchCriteria[page_size]=26"

hopefully this will help your I'm just a newbie.

if you want status outofstockvalue=2 instockvalue=1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.