Retrieving all orders

Solved
jihoro
New Member
3 0 1

I tried (in Ruby)

@orders = ShopifyAPI::Order.find(:all, params: { limit: 100 }), but it only returns unfulfilled orders.
 
So I've been trying to use the GET method but it seems to be detecting a syntax error when I do something like 
@orders = GET /admin/orders.json?status=any&fulfillment_status=any. 
 
How can I fix my code so that it returns all orders?
HunkyBill
Shopify Expert
4549 48 509

This is an accepted solution.

First off, you would be wanting to add code to your params. So you add:

  • status: 'any'
  • page
  • limit

And with that, you can ask for page 1, a limit of 250 orders, and you'll get up to 250 orders of any status. The default of fulfillment_status is any, so you do not need that. 

 

Also note that unless otherwise approved, you only get orders from the last 60 days unless you demonstrated a need for more. Most people will get a count of all orders, and then use the limit of 250 to figure out how many pages of orders they have, and then iterate through the pages to get all their orders of interest.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
Meghala
New Member
2 0 0

Order number 5667 via Instagram 

0 Likes
tusharagrwal
New Member
2 0 0

when I am using page parm then I have facing these issue

{
    "errors": {
        "page""page cannot be passed. See https://help.shopify.com/api/guides/paginated-rest-results for more information."
    }
}
 
so how to resolve the issue
0 Likes
HunkyBill
Shopify Expert
4549 48 509

Page is no longer supported and has not been supported for some time. If you examine the documentation for GraphQL, you will see resources now function with a cursor value, and if you use the old RestAPI, you'll find values in the header for next page and previous page. You use those to get at records, you no longer "pass" a page value.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes