cancel
Showing results for 
Search instead for 
Did you mean: 

How to integrate the orders of last seven days.

SOLVED

How to integrate the orders of last seven days.

Hello, 

I want to integrate the API of last seven days orders in magento2.For Integrate the API of all orders which parameters I set.

Any suggestion regarding this is very helpful.

 

Thank You

2 REPLIES

Re: How to integrate the orders of last seven days.

Hi @harshita_chouhan,

 

Maybe with something like this?

 

/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=created_at&searchCriteria[filter_groups][0][filters][0][value]=2018-05-04T00:00:00.0000000Z&searchCriteria[filter_groups][0][filters][0][condition_type]=from&searchCriteria[filter_groups][1][filters][0][field]=created_at&searchCriteria[filter_groups][1][filters][0][value]=2018-05-11T00:00:00.0000000Z&searchCriteria[filter_groups][1][filters][0][condition_type]=to&searchCriteria[currentPage]=1&searchCriteria[pageSize]=100

You should calculate your dates dinamically but I guess this should work.

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: How to integrate the orders of last seven days.

Hello @Damian Culotta,

Thanks For your response. It really helps me. I can change it like :

/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=created_at&searchCriteria[filter_groups][0][filters][0][value]=2018-05-11T00:00:00.0000000Z&searchCriteria[filter_groups][0][filters][0][condition_type]=from&searchCriteria[currentPage]=1&searchCriteria[pageSize]=10

Thanks again.