Pulling large results on orders endpoint

Hi Guys,

We are in the process of pulling a large number of orders from a large number of stores and I’m trying to work out the best way to do it.

My initial thought was to order the results by ID ascending and use the since_id to make sure I get them all.

However I don’t actually see a way to sort/order the results via the API.

it looks like the results are showing newest orders first, so that will not work.

As the API max limit is 250 records, I’m not quite sure how to get older ones. Unless the pagination works with result set > 250 but just gives 250 per page?

Any pointers on how to work with large datasets via the Rest API would be appreciated

Hi there :waving_hand:

I would definitely recommend checking out the documentation on Pagination with the REST API!

You will be able to get a page of 250 results and you will be also be returned a cursor which can be used to retrieve the next page of 250 results.

Thanks @lizk

That was the right approach, if anyone is looking for the same and you are using the Node SKD provided by Shopify and are unsure how to get it working, you can checkout my code here:

https://github.com/juicyllama/framework/blob/main/apps/shopify/src/modules/orders/orders.service.ts#L26

Its using NestJs but you should be able to pull out he bits you need.