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
?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityYou 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