Shopify orders api misses some orders

Shopify orders api misses some orders

tayyabawan
Shopify Partner
2 0 0

I want to get orders based on date range for example orders of today or yesterday etc. Problem is that I get the count of orders for specified date correctly, but when I hit the api to get all those orders then some of them are missing in response. Here are api endpoints that I am hitting:

For orders count of today:

https://mystore.myshopify.com/admin/api/2021-10/orders/count.json?created_at_min=2022-01-06T00:00:00...

 

For fetching orders of today:

 https://mystore.myshopify.com/admin/api/2021-10/orders.json?created_at_min=2022-01-06T00:00:00+05:00...

 

Any help is appreciated.

 

Reply 1 (1)

tayyabawan
Shopify Partner
2 0 0

Okay so problem was in the format of date which I was providing in /orders.json api. Found this answer from @mayoub  helpful: https://community.shopify.com/c/shopify-apis-and-sdks/some-orders-are-missing-shopify-order-api/td-p....

 

Just use the ISO format for dates instead of adding timezone offset.

instead of: 

2022-01-06T00:00:00+05:00

use this:

2022-01-05T19:00:00.000Z 

 

But yes still do'nt know why /count.json api worked with timezone offset instead of ISO format.