cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2REST API searchCriteria date range

SOLVED

Magento 2REST API searchCriteria date range

Hello,

Firstly I should let you know I am a newbie to Magento. Our configuration is Magento 2.3, and Boomi, on a Linux box on our local network. I would like to query the sample Magento site that was installed when Magento was installed. I am trying to get all orders between 2 dates and that has not worked for me so I thought I would try to get all orders after a certain date. I am trying to use Postman to get all orders after the date 1/12/2019 by using this request

 

searchCriteria[filter_groups][0][filters][0][field]=created_at&
searchCriteria[filter_groups][0][filters][0][value]=2019-01-12&
searchCriteria[filter_groups][0][filters][0][condition_type]=gt
 
When I send the request I get this as a response
<message>"%fieldName" is required. Enter and try again.</message>
 Any ideas what I am doing wrong is appreciated.
Joled
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2REST API searchCriteria date range

Hi @joled 

 

I think you are using enter between filters. So please use this URL. 


 https://localserver.com/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=created_at&searchCriteria[filter_groups][0][filters][0][value]=2019-01-12&searchCriteria[filter_groups][0][filters][0][condition_type]=gt 

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

Thanks Smiley Happy

View solution in original post

3 REPLIES 3

Re: Magento 2REST API searchCriteria date range

Hi @joled 

 

I think you are using enter between filters. So please use this URL. 


 https://localserver.com/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=created_at&searchCriteria[filter_groups][0][filters][0][value]=2019-01-12&searchCriteria[filter_groups][0][filters][0][condition_type]=gt 

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

Thanks Smiley Happy

Re: Magento 2REST API searchCriteria date range

Thank you Geeta, That was the problem. In Postman it looked like it was just a line wrap but there were returns at those positions where the line ended.

 

Best regards,

Joe

Re: Magento 2REST API searchCriteria date range