Hi All,
I´m searching for an endpoint to retrieve orders according to a status like "Pending".
I see that there is an endpoint GET /v1/api/orders that receives "Search Criteria" parameter type. That is new to me and I didn´t figure out how it works.
I read this doc https://devdocs.magento.com/guides/v2.1/rest/performing-searches.html but to be honest I got what is a search criteria but when I try to use it, it doesn´t work.
Can you please give a detailed explanation about it and if possible build the endpoint call to get pending orders?
Thank you!
Hello @bruno_soares
You can use the searchCriteria for filtering the pending orders.
See the example given below.
$requestUrl='http://www.yourdomain.com/index.php/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=status&searchCriteria[filter_groups][0][filters][0][value]=pending&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[pageSize]=100';
Is there a way by which we can get the orders with 2 status. ie pending and processing both?