0

I have an integration that must get my products in stock via the Magento 2 API using SearchCriteria.

How could I filter it, since it's inside my custom_attributes?

1 Answer 1

1

You can filter normally as any other attribute. Use this URL below to request, I'm using the rule "if it's greater than 0 than" to get products, and I put the limit of 50 products. The counting of total products is included during the return as you can see in the image.

https://www.mystore.com/ca_en/rest/all/V1/products?
searchCriteria[filterGroups][0][filters][0][field]=is_in_stock&
searchCriteria[filterGroups][0][filters][0][value]=0&
searchCriteria[filterGroups][0][filters][0][conditionType]=gt&
searchCriteria[pageSize]=50

enter image description here

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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