After listening to early adopters of the Shopify API in the Developer Forums, we’ve rolled out the ability to issue count requests on resources like
Orderand
Product
The count requests look like and take the same conditions and parameters you’d give to the existing find request you’re used to – they just return a count of how many orders, products or other resource you’re querying for.
Here’s an example of how to ask how many orders have yet to be shipped:
http://snowdevil.myshopify.com/admin/orders/count?fulfillment_status=unshippedWe’ve also added counting to the ShopifyAPI library that comes with the shopify_app plugin, so you can now write
ShopifyAPI::Order.count(:status => "unshipped")and you’ll get back just what you expect.
Check out the updated docs in http://api.shopify.com and the open-source shopify_app plugin at Github.
Topics:
Join 379,633 entrepreneurs who already have a head start.
Get free online marketing tips and resources delivered directly to your inbox.
Thanks for subscribing
You’ll start receiving free tips and resources soon. In the meantime, start building your store with a free 14-day trial of Shopify.