I'm working with a store that does around 70 - 100k orders a month and when i try to query orders using date collars on "updated_at_min" and "updated_at_max" I only get around 200 orders per day, which doesn't work out.
How would one retrieve all orders for a store? I'm using
as an example, and I'm getting 0 orders in response, when if I look at the same orders from ship hero I see 748 orders.
How do I get actual API support from shopify? Are these forums the only way?
Hi, I am a developer and understand your issue. The Shopify API actually a max of 250 order per request. So you get 250 orders, you have and note the id of the last order.
Now make another request and put the last id of the previous request in since_id parameter
see example below
let's say you made a request, Shopify returned 250 orders and the id of the last order is 5600250, so now you have to make another request and put this 5600250 in since_Id parameter
Repeat this until you get no order. I can solve your code if you need my help.
Muhammad Rafi QureshiDeveloper
Let's start with your url formatting to start with. It's wrong as you have two ? in your url. There should be only one to indicate the start of the querystring.
Now why you're getting 8 is less likely down to that. Consider adding the status parameter in there as well (see the docs).
In case someone else is looking here, "page" is not a valid variable to send which is why no results return.
Also note, when pulling orders using date and not using since_id - you get the last 250 orders of the day, not the first.
The way I get data when there are more than 250 orders in a day is get the id of the last order of the day before and run a loop using since_id and limit 250 until I get less than 250 results. I combine the results on each loop for a complete set of orders.
This is using PHP
$orders = $shopify('GET', '/admin/api/2019-10/orders.json', array('status'=>'any','created_at_min'=>PREVIOUS DAY START,'created_at_max'=>PREVIOUS DAY END,'limit'=>1,'fields'=>'id'));
then query using since_id (i use a do while loop to update the since_id and get the next chunk of orders)
$orders = $shopify('GET', '/admin/api/2019-10/orders.json', array('since_id'=>$sinceid,'created_at_min'=>YESTERDAY START,'created_at_max'=>YESTERDAY END,'limit'=>250,'fields'=>'id,order_number,line_items'));