What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

shopify admin api

Solved

shopify admin api

bguse
Shopify Partner
20 2 4

i am attempting to request orders using shopify admin api. my orders.json response is coming back blank.

{
    "orders": []
}

This was working earlier today but my partner changed the shop store. but it has been changed back. (he capitalized and added a space)

any idea why this would happen or how to fix it?
Accepted Solution (1)
bguse
Shopify Partner
20 2 4

This is an accepted solution.

Thank you for asking! I couldn't figure out how to reply to my own message after I was able to figure out what I was doing wrong. using a simple python url get request would return blank orders json file. That's because this API only returns current unfulfilled orders!

url = f"https://{shop_name}.myshopify.com/admin/api/2023-01/orders.json"
 
I was able to ask Shopify help and the nice person was able to find this to be able to show any recent orders
url = f"https://{shop_name}.myshopify.com/admin/api/2023-01/orders.json?status=any"

I hope this response will help anyone in the future that is also having this issue. 


 

View solution in original post

Replies 2 (2)

garyrgilbert
Shopify Partner
431 41 188

Is it still returning zero orders?

 

Double check the shops myshopify.com domain to make sure that its correct, though you probably would receive a different error in that case...

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
bguse
Shopify Partner
20 2 4

This is an accepted solution.

Thank you for asking! I couldn't figure out how to reply to my own message after I was able to figure out what I was doing wrong. using a simple python url get request would return blank orders json file. That's because this API only returns current unfulfilled orders!

url = f"https://{shop_name}.myshopify.com/admin/api/2023-01/orders.json"
 
I was able to ask Shopify help and the nice person was able to find this to be able to show any recent orders
url = f"https://{shop_name}.myshopify.com/admin/api/2023-01/orders.json?status=any"

I hope this response will help anyone in the future that is also having this issue.