Re: Empty orders array returned

Empty orders array returned

qwertyu
Visitor
3 0 0

Greetings,

 

We recently identified a problem with our Shopify API while retrieving orders. The behavior is unstable with some orders that are working and some others not.

 

For instance, this call returns an empty array https://XX:[email protected]/admin/api/2021-07/orders.json?ids=4238414479530

U2NyZWVuc2hvdCAyMDIyLTAxLTIwIGF0IDE0LjQ4LjEzLnBuZw==.png

 

This one is working: https://XX:[email protected]/admin/api/2021-07/orders.json?ids=4238688485546Screenshot 2022-01-20 at 15.05.58.png

 

How could we solve this issue? All our systems depend on Shopify.

 

Thank you

Replies 5 (5)

tolgapaksoy
Shopify Partner
112 7 71

How old is Order with ID 4238414479530? Shopify only returns orders that are upto 60 days old. If you need orders older than that, you need to request special permissions on your App settings screen.

qwertyu
Visitor
3 0 0

Thanks @tolgapaksoy for your assistance.

No, the order has been placed on Jan 14th 2022.Screenshot 2022-01-21 at 10.02.04.png

csam
Shopify Staff (Retired)
267 40 51

Hi @qwertyu 

 

I would recommend contacting Shopify support to have technical support take a look at the store for you as it seems there may be something going wrong with this particular order. If you are not the store owner and do not have a a staff account on the store, please have the owner or a staff member contact support with the information directly.

 

Thanks!

To learn more visit the Shopify Help Center or the Community Blog.

qwertyu
Visitor
3 0 0

Hi @csam 

Unfortunately, there are other orders having this issue.

How can I get in touch with the technical support? When discussing with customer care, they recommended posting the problem in the forum as they cannot help on the technical side.

 

Thank you

csam
Shopify Staff (Retired)
267 40 51

Hi @qwertyu 

 

I did some testing and found that if you add a parameter for the order status of status=any it will return the order this way. Eg. /admin/api/2021-07/orders.json?ids=4238414479530&status=any

 

Only open orders are returned by default via the orders.json endpoint on the REST API, so if you want all orders, you will need to specify "any". Alternatively you can use the format /admin/api/2021-07/orders.json?id=4238414479530 or /admin/api/2021-07/orders/4238414479530.json to return a single specific order of any status. Hope this helps!

 

To learn more visit the Shopify Help Center or the Community Blog.