Not able to fetch all orders from shopify store

omkarlanghe
New Member
3 0 0

Hello,

Through my below code, I am only able to sync 250 orders from store. I am using https://www.npmjs.com/package/shopify-node-api node library for this and they have mentioned

to fetch orders using nextPageParameters. Am I doing anything wrong while syncing orders ? As It seems original orders on my stores are nearly around 1000, but I get only 250 orders.

 

            let orders_list = [];
            let params = { 'limit': 250 };
            do {
                const orders = await shopify.order.list(params);
                for (let i = 0; i < orders.length; i++) {
                    orders_list.push(orders[i]);
                }
                params = orders.nextPageParameters;
            } while (params !== undefined);

 

 

 As per my understanding limit = 250 every time do while loop will give me new 250 orders ...!

0 Likes
olivert
Explorer
51 11 14

Hi mate, 

Hmm.

Do you have the read_all_orders scope?

Needed to read orders older than 60 days

Details below:

https://community.shopify.com/c/API-Announcements/ACTION-REQUIRED-Apps-require-Shopify-approval-to-r...

0 Likes