shopify_api ShopifyAPI::Order.find for refunded orders

471 views
Skip to first unread message

Andy

unread,
Jul 5, 2011, 2:03:04 PM7/5/11
to shopify-api
How to I retrieve a list of refunded orders using the Shopify API ruby
gem? I know I can use ShopifyAPI::Order.find(:all) to get a list of
all orders, but it seems to ignore any orders that don't have a
financial status of "paid" or "authorized". When I use GET /admin/
orders.json?financial_status=refunded using an HTTP application, I can
successfully retrieve this list, but when I try
ShopifyAPI::Order.find(:all, :params => { :financial_status =>
'refunded' } ), it still only retrieves orders that have the financial
status "paid" or "authorize".

Andy

unread,
Jul 5, 2011, 2:23:51 PM7/5/11
to shopify-api
It looks like I was wrong about using the GET /admin/ orders.json?
financial_status=refunded. That doesn't retrieve a list of refunded
orders either. Is it possible to do this at all?

Denis Odorcic

unread,
Jul 5, 2011, 2:32:57 PM7/5/11
to shopi...@googlegroups.com
Hey Andy,

That's correct. Right now you can't target refunded/voided orders with find(). The docs at http://api.shopify.com/order.html#index specify which ones you can. Until the functionality is added, I guess you'll have to workaround it by getting them all and selecting the ones that have that financial status?

Andy

unread,
Jul 5, 2011, 2:36:00 PM7/5/11
to shopify-api
Hi Denis,

Thanks for such a quick response! How do I get a list of all orders?
Using ShopifyAPI::Order.all still gives just a list of paid and
pending orders.

On Jul 5, 2:32 pm, Denis Odorcic <denis.odor...@jadedpixel.com> wrote:
> Hey Andy,
>
> That's correct. Right now you can't target refunded/voided orders with
> find(). The docs athttp://api.shopify.com/order.html#indexspecify which

Denis Odorcic

unread,
Jul 5, 2011, 2:58:05 PM7/5/11
to shopi...@googlegroups.com
You can do ShopifyAPI::Order.find(:all, :params => {:financial_status => 'any'}) and that should return all the orders (besides ones that were abandoned).

Let me know if that works.

Andy

unread,
Jul 5, 2011, 3:00:31 PM7/5/11
to shopify-api
Setting financial_status to any didn't work, but setting status to any
does work.

Thanks!

Denis Odorcic

unread,
Jul 11, 2011, 2:44:16 PM7/11/11
to shopify-api
Hey Andy,

Right. You can view the filters on http://api.shopify.com/order.html#index
and note the default values (status is defaulted to open).
The financial_status filters for 'refunded' and 'voided' have been
added, so you can do something like this now to get all refunded
orders:

ShopifyAPI::Order.find(:all, :params => {:status =>
'any', :financial_status => 'refunded'})

Denis
Reply all
Reply to author
Forward
0 new messages