Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Order API not working in some stores

hussainbadusha
Shopify Partner
8 0 0

Hi,

We have number of clients using our app. We normally fetch orders after getting access_token from the store and process them as per our needs.

Everything was working fine. But now one of our clients was complaining that your app doesn't show any orders even though i have received orders in recent days.

So we have checked if his store has orders in the last 60 days from our side. Unfortunately, order api returns empty result set.

Any help would be greatly appreciated.

Regards,

Hussain

Replies 4 (4)

Kevin_A
Shopify Staff
318 42 61

Hey @hussainbadusha 

Can you share the x-request-id response header from one of the API calls that isn't working correctly? 

Kevin_A | Solutions Engineer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

hussainbadusha
Shopify Partner
8 0 0

Hi, Kevin

Thanks for the reply.

Here is the x-request-id

7254ac80-47aa-4549-a12f-28e804c2436d

Kevin_A
Shopify Staff
318 42 61

Hey @hussainbadusha 

By default when calling the order endpoint, we use status=open which means if orders are archived they won't get pulled. You will want to add status=any on the end:

/admin/api/2020-01/orders.json?order=created_at+desc&limit=100&status=any

  For reference: https://shopify.dev/docs/admin-api/rest/reference/orders/order#index-2021-01

As a side note, you are requesting 2020-01 API version but these are all being forwarded to 2020-04 (and will continue to be forwarded to newer versions as API versions are deprecated). I would suggest trying to migrate to the latest API version so you don't run into issues in the future. 

Kevin_A | Solutions Engineer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

hussainbadusha
Shopify Partner
8 0 0

Hi Kevin,

Thanks for the information.

It works now and yes we will migrate API version to latest

Once again thanks.