I want to fetch all orders between date range using Shopify REST API
( I used nodejs package : https://github.com/Shopify/shopify-api-js )
But I got wrong result.
This is code example.
const created_at_min = "2023-03-07 00:00:00.000"
const created_at_max = "2023-03-07 23:59:59.000"
const orders = await shopify.rest.Order.all({
session: session,
status: "any",
created_at_min: created_at_min,
created_at_max: created_at_max
});
console.log(orders.length) /// 25
In this case, total orders count is 25. this is wrong value.
When I tried to use another method, the result is correct.
const created_at_min = "2023-03-07 00:00:00.000"
const created_at_max = "2023-03-07 23:59:59.000"
const ordersCount = await shopify.rest.Order.count({
session: session,
status: "any",
created_at_min: created_at_min,
created_at_max: created_at_max,
});
console.log(ordersCount) /// count: 58
I can not understand why the same date parameters return different results.
Please help me. Thank you.