You’re correct in what the page option does. You need both to access a specific range of orders. For example, if you set the limit to 50, then page 1 would have 1 – 50, page 2 would have 51-100, etc.
However, I don’t think there’s a way to get the total count of orders for a shop. This would be a great addition to the API.
I agree that having that sort of functionality in the API would be really handy.
Next week I’ll be prototyping what we’ll need to have something like
GET /admin/orders/size => 20
/admin/ordersand will only respond to GET.
I’ll keep you guys updated.
Timcase, both are correct. Think of it from the point of view of the HTML interface and how pagination works there. Essentially all what changes for the API is that you add .xml to the url and we will sent the XML representation of the same items on the wire as we would usually display in html. This also means that all the query parameters from the API work in html as well (e.g. you can bookmark a screen that only shows orders that were placed since a certain date for example).
and friends now works with the conditions that you’re used to.
The shopify_api.rb file included in the shopify_app plugin has also been updated so that you can do
ShopifyAPI::Order.count(:status => "shipped")
and it’ll return what you expect.
See http//api.shopify.com for more.
(Yes, the api docs do need some love; it’s on the list :)