0

I want to sort the product list by quantity using the REST API in magento2.

I tried below endpoints :

rest/V1/products&searchCritseria[sortOrders][0][field]=quantity_and_stock_status&searchCriteria[sortOrders][0][direction]=DESC

rest/V1/products&searchCritseria[sortOrders][0][field]=qty&searchCriteria[sortOrders][0][direction]=DESC

rest/V1/products&searchCritseria[sortOrders][0][field]=quantity&searchCriteria[sortOrders][0][direction]=DESC

rest/V1/products&searchCritseria[sortOrders][0][field]=stock&searchCriteria[sortOrders][0][direction]=DESC

But not working properly. How can I get the product list in descending order by the quantity of the product ?

Your Answer

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

Browse other questions tagged or ask your own question.