Empty orders array returned

Topic summary

Problem: Some Shopify REST API calls to orders.json with the ids parameter returned an empty array for specific orders, while others worked.

Key details:

  • The affected order was recent (placed Jan 14, 2022), so Shopify’s 60-day limit for returning orders didn’t apply.
  • The REST endpoint /admin/api/2021-07/orders.json defaults to returning only open orders.

Resolution and guidance:

  • Adding the query parameter status=any (e.g., /admin/api/2021-07/orders.json?ids=4238414479530&status=any) returns the order by including all statuses.
  • Alternatives to fetch a single order of any status: /admin/api/2021-07/orders.json?id=4238414479530 or /admin/api/2021-07/orders/4238414479530.json.

Implication:

  • Affected orders were likely not in “open” status, causing empty results under default behavior.

Actions:

  • Update integration to include status=any when querying orders or use the specific-order endpoints.
  • Contact Shopify support if issues persist across multiple orders beyond status filtering.

Status: Resolved with parameter adjustment; no remaining disagreements noted.

Summarized with AI on February 24. AI used: gpt-5.

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:XX@XX.myshopify.com/admin/api/2021-07/orders.json?ids=4238414479530

This one is working:https://XX:XX@XX.myshopify.com/admin/api/2021-07/orders.json?ids=4238688485546
Screenshot 2022-01-20 at 15.05.58.png

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

Thank you

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.

Thanks @tolgapaksoy for your assistance.

No, the order has been placed on Jan 14th 2022.

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!

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

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!