Maybe someone can easyls help here
Will only return the lastest 50 Orders. How Can i change the behaviour oF API only to consider really what is given as Filter parameter?
Any helüp very much welcome. BR. TJ
Solved! Go to the solution
If orders are older than 60 days and your API credentials don't have that granted access then this could be why. Check here for specifics --> https://shopify.dev/docs/admin-api/rest/reference/orders/order.
50 is the default if you don't add the "limit" parameter to your URL
250 is the maximum .. the results are also paged so in the http response header you will have to check to see if you have a "previous" or "next" url and follow that url to get the previous/next chunk of results..
so in your case:
btw location_id won't filter anything since see here for available parameters
any parameters not in that table will be ignored.. sadly.. I am also looking to filter the orders by location_id
@TonyJ I don't know how many other API providers you've worked with, but most of their REST implementation employ some type of paginated response sets. With Shopify's GraphQL API, you can issue a bulk operation request and then download a JSONL file with all the records. That's an option.
Why would you need to get all the orders? What is your use case for needing to return all orders?
I can't think of any off the top of my head? As Greg already answered most modern rest api's will have some kind of paged response in order to limit resource usage on their end.. think of a very popular store with perhaps millions of orders in a year..
select * from .. not the best idea from an implementation perspective.
@garyrgilbert there are occasional one-off needs for this scenario. One example that comes to mind is when a large data conversion is taking place. First thing I do is pull all records, then only delta sync records over a polling period. Like when I had to initially pull all Shopify products to push over into Lightspeed Retail *shudder*.
In that case, if it's a choice between parsing Shopify REST API response headers to advance pages versus a one-shot Shopify GraphQL API bulk operations request, I'll go GQL every time. Just download the JSONL results file with everything in there and be done with it.