How to fetch orders between date range using Shopify REST API?

I want to fetch orders between two dates using Shopify REST API, so-far I’m trying to achieve this via below endpoint

> /admin/api/2020-07/orders.json?status=any&created_at_min=2022-04-14 00:00:00.000&created_at_max=2022-04-14 24:00:00.000> > > It returns total 2134 orders also it includes orders of2022-04-15 But as per Shopify the total orders of 2022-04-14 are 2141.> > However, when I consume the below mentioned order count endpoint using the same date range, it returns the correct count, just as Shopify shows. 2141

/admin/api/2020-07/orders/count.json?status=any&created_at_min=2022-04-14 00:00:00.000&created_at_max=2022-04-14 24:00:00.000

I am unable to understand why the same date parameters return different results.

Please advise how to achieve this. Thank you!

Hey @Ahad007 ,

Thanks for taking the time to post those details about some unexpected results when querying your store’s order totals using the REST Admin API.

Our team is not able to provide authenticated support, or access the details of individual merchant’s stores/apps via these forums posts at this time, but if you are still able to replicate this behaviour then I would recommend connecting directly with Shopify Support from an authenticated email to have one of our teams take a closer look.

Please make sure to include the details of the current totals displaying in your Shopify Admin, the API calls you used, when you received this result, and the X-request-id headers included in those responses to help them confirm the expected behaviour.

You are also welcome to share the API docs you are using, examples of expected responses if you received a different result prior to this, or any other context to help them investigate faster.

Cheers,

you get this solved @Ahad007 ?