What are the alternate ways apart from cursor based pagination to get more than 250 orders?

Highlighted
New Member
1 0 0

We are feeling cursor based pagination is doubling the work to get orders when it crosses more than 250 a day. It is affecting the performance as well, Also every time we need to track the orders if it crosses 250. So i am requesting to provide some alternate and best solution to get more than 250 orders a day.

0 Likes
Highlighted
Shopify Partner
648 46 130

If you're willing to use the GraphQL API (assuming your question was regarding the REST API), then you can perform a bulk operation to retrieve them. Details are explained here --> https://shopify.dev/tutorials/perform-bulk-operations-with-admin-api

In a nutshell, you create your bulk query and post the request. Then you poll the bulk operation until its response indicates it's completed. Finally, you download the JSONL results as a file and can iterate through the lines. As I explained in a different thread, it's a lot more efficient. A test I performed yesterday I pulled 49K products in 11 minutes via bulk operations. If I used the REST API this same operation would've taken awhile to iterate through using the pagination and whatnot.

0 Likes
Highlighted
Excursionist
28 5 3

hello,

can you please tell me what kind of orders you want . I will send you one script here you just need to run it on BASH. 

it will automatically check if header has next page then it will take otherwise it will stop.

then i will explain you in detail that code.

Thanks

0 Likes
Highlighted
New Member
4 0 0

@msk I would be interested in this. We try to get all "open" (unfilfilled) orders.

0 Likes
Highlighted
New Member
1 0 0

can we do it on weekend?

0 Likes
Highlighted
Shopify Partner
648 46 130

@muhammadsalmank did you try the GraphQL bulk operation? That's a one-shot deal where you just poll to see if the operation has completed. If it has then you receive a download URL and can grab the entire recordset. For anything larger I'd recommend this...

0 Likes
Highlighted
Excursionist
28 5 3

Hello @Greg_Kujawa 

yes you are right. i used it but for me this is best when you need to update so big records etc. i used it for one client. can i hep you in this or you need something.

Thanks

0 Likes
Highlighted
New Member
4 0 0

Hi guys

We im port all the open orders to a google sheet, do some operations and print highly customized pack sheets. I wondered whether the way we import the orders still will work... with the new pagination requirement?! I mean it's limited to 250 anyway what I would like to change....

This is how we fetch the data i google sheet script:

function fetchData() {
var url = 'https://shop.myshopify.com/admin/orders.json?limit=250&page=1',
apiusername = 'xxx',
apikey = 'yyy',
sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Inbox');

 

 

 

0 Likes
Highlighted
Excursionist
28 5 3

when page parameter will completely finished then 100% not

0 Likes
Highlighted
New Member
4 0 0

OK thank you @msk , what could be a potential solution? How could I adjust the script code?

0 Likes