cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an API endpoint to get "Pending" orders?

Is there an API endpoint to get "Pending" orders?

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!

2 REPLIES 2

Re: Is there an API endpoint to get "Pending" orders?

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';

 

If you find my answer useful, Please click Kudos & Accept as Solution.

Re: Is there an API endpoint to get "Pending" orders?

Is there a way by which we can get the orders with 2 status. ie pending and processing both?