Cjoerg
Cjoerg

Reputation: 1325

How to retrieve orders from Shopify through the shopify_api gem?

I am in the process of integrating an app to Shopify. I am using the shopify_api gem to retrieve orders, but I am finding that the documentation and Readme does not cover much. And the REST API documentation does not easily translate into shopify_api methods.

I have read that you can query for orders with params, but I get 50 more or less random orders returned when doing so:

puts ShopifyAPI::Order.find(:all, params: { order_number: 1606 }).size # => 50

I would also like to be able to retrieve orders from a given created_at date and from a given order_number.

Upvotes: 0

Views: 2232

Answers (1)

Bjorn Forsberg
Bjorn Forsberg

Reputation: 470

To give you a bit more info on where to look in the docs, this would be a good start:

http://docs.shopify.com/api/order#index

This gives you the full list of parameters you can filter/query by.

So for example:

puts ShopifyAPI::Order.find(:all, :params => {:status => 'any', :limit => 250})

Let me know if you have more specific question on a particular filter/query you are attempting.

Upvotes: 2

Related Questions