5

I am reading orders from a WooCommerce site with the REST API (v1, OAuth), filtering for order status:

http://mypage.com/wc-api/v1/orders?status=on-hold

Works fine.

Now I would like to filter for multiple statuses. Is this possible? Like:

http://mypage.com/wc-api/v1/orders?status=on-hold,pending

This site suggests so:

You can retrieve orders with a specific status using the ?status parameter, using commas to separate multiple statuses.

(I've already tried, but I was not able to build a valid oauth_signature with the comma, probably some kind of encoding issue. So before I keep trying, I would like to know if multiple statuses are possible in the first place.)

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Manuel M
  • 809
  • 1
  • 10
  • 25
  • Out of my depth with the API unfortunately, but what if you [encode](http://www.degraeve.com/reference/urlencoding.php) the comma as `%2C`? – helgatheviking Jul 22 '15 at 14:51
  • Why are you using v1 along with oAuth? v1 will eventually be removed so it'd be best to try building with v2 at this point. For security purposes, might also be a good idea to use SSL. – Michael Jul 22 '15 at 16:03
  • Also note the official documentation is here: http://woothemes.github.io/woocommerce-rest-api-docs/ – Michael Jul 22 '15 at 16:04
  • @helgatheviking yes, already tried that, but no succes. – Manuel M Jul 27 '15 at 07:32
  • @MichaelT we'll switch to v2 in the future, but we need to support WooCommerce 2.1 for now. However I'll try if it works with v2! PS. we are also using https (if the client supports it). – Manuel M Jul 27 '15 at 07:39

1 Answers1

4

I finally found the reason for not being able to build a correct oauth_signature: the comma has to be double-encoded (see here for details).

Answer: yes - it is possible to select multiple statuses comma-delimited just like that:

http://mypage.com/wc-api/v1/orders?status=on-hold,pending

This works in v1, v2 and v3.

Manuel M
  • 809
  • 1
  • 10
  • 25