Unable to sync orders before 60 days.

Highlighted
New Member
6 0 0

Hello Everyone,

I am unable to sync orders before 60 days from my app. I am having Read all orders access for my app.

I am using PHP for syncing orders. Below is my code.

$shopify = shopify\client($shopify_store, SHOPIFY_APP_API_KEY, $shopify_access_token);

$all_order_data_array = $shopify('GET /admin/api/2020-04/orders.json', array('status'=>'any','updated_at_min'=>$last_updated_date,'since_id'=>$since_id,'limit '=>'50'));

Screen Shot 2020-06-29 at 12.15.27 PM.png

0 Likes
Highlighted
Shopify Partner
262 16 41

@bharatkarotra11 ,

 

You need "read_all_orders" in your permissions scope. As of June 6th, 2018, only the last 60 days' worth of orders from a store will be accessible from the Order resource by default.

https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/local-methods/loca...

Probably your code who knows what those variables will be. Just do 'limit '=>'50' leave out the other options. 

Best,


Sam 

 

Custom Apps and Themes Support | hello@achieveapplabs.com
0 Likes
Highlighted
New Member
6 0 0

HI @achieveapplabs 

0 Likes
Highlighted
Shopify Partner
262 16 41

@bharatkarotra11 ,

 

Your code then. Leave just limit param like I suggested and try again. 

 

Best,

 

Sam

Custom Apps and Themes Support | hello@achieveapplabs.com
0 Likes
Highlighted
New Member
6 0 0

Hi @achieveapplabs 

I have tried below variations. Still not working.

$all_order_data_array = $shopify('GET /admin/api/2020-04/orders.json', array('status'=>'any','since_id'=>'0','limit '=>'50'));
$all_order_data_array = $shopify('GET /admin/api/2020-04/orders.json', array('since_id'=>'0','limit '=>'50'));
$all_order_data_array = $shopify('GET /admin/api/2020-04/orders.json', array('status'=>'any','limit '=>'50'));
$all_order_data_array = $shopify('GET /admin/api/2020-04/orders.json', array('limit '=>'50'));
$all_order_data_array = $shopify('GET /admin/api/2020-04/orders.json', array());
0 Likes
Highlighted
Shopify Partner
262 16 41

Then try a different API version like 2020-01.

Custom Apps and Themes Support | hello@achieveapplabs.com
0 Likes
Highlighted
New Member
6 0 0

Hi,

I have tried with API version like 2020-04, 2020-01, 2019-10, 2019-07, 2019-04.

I am facing the same issue with all the API Version.  

0 Likes
Highlighted
Shopify Partner
262 16 41

Just to be clear you're getting a valid response? Also have you done this section? https://shopify.dev/tutorials/authenticate-a-public-app-with-oauth#orders-permissions

Shopify needs to also approve your permission to read_all_orders, so open a ticket in your partner dashboard @bharatkarotra11 also mark this as solved because this answer is there for everyone to see.

Custom Apps and Themes Support | hello@achieveapplabs.com
0 Likes
Highlighted
New Member
6 0 0

Yes i have already done with this section.

Here again attaching the screenshot for the same.

Screen Shot 2020-06-29 at 12.15.27 PM.png

0 Likes
Highlighted
Shopify Staff
Shopify Staff
464 57 91

Hey @bharatkarotra11,

Can you please provide the X-Request-ID from the response headers of a few API calls that aren't returning a response? I'll use this to check our logs and hopefully dig up some more information.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes