Title: REST API: syntax for array query parameters
Last modified: October 15, 2019

---

# REST API: syntax for array query parameters

 *  Resolved [therealgilles](https://wordpress.org/support/users/chamois_blanc/)
 * (@chamois_blanc)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-syntax-for-array-query-parameters/)
 * I am wondering what the proper syntax is for query parameters which are arrays.
 * Is it:
    …?param=foo,bla,moo
 * or:
    …?param=foo&param=bla&param=moo
 * or:
    …?param[]=foo&param[]=bla&param[]=moo
 * Thank you for clarifying 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [3 Sons Development](https://wordpress.org/support/users/3sonsdevelopment/)
 * (@3sonsdevelopment)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-syntax-for-array-query-parameters/#post-12044034)
 * Hey [@chamois_blanc](https://wordpress.org/support/users/chamois_blanc/),
 * Could you let us know which version of the REST API you’re working with? You 
   can find them all listed at the top of this document:
 * [https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction](https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction)
 * Thanks
 *  Thread Starter [therealgilles](https://wordpress.org/support/users/chamois_blanc/)
 * (@chamois_blanc)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-syntax-for-array-query-parameters/#post-12044757)
 * I am working with the latest REST API version: v3
 * I am using `...?status=pending,completed` and it seems to work, but it would 
   be great to get it documented.
 *  [3 Sons Development](https://wordpress.org/support/users/3sonsdevelopment/)
 * (@3sonsdevelopment)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-syntax-for-array-query-parameters/#post-12050920)
 * Hello [@chamois_blanc](https://wordpress.org/support/users/chamois_blanc/),
 * Thanks for getting with me about that. So for items in an array, separating the
   values with commas works for me as well. On my test site, this will pull products
   that have variations with these terms. It leaves out the products that don’t 
   have those terms.
 *     ```
       /wp-json/wc/v3/products?attribute=pa_color&attribute_term=42,41
       ```
   
 * If you do run into trouble formatting them that way, let me know.
 *  Plugin Support [EtienneP a11n](https://wordpress.org/support/users/etiennep/)
 * (@etiennep)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-syntax-for-array-query-parameters/#post-12071432)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   if you have any further questions, you can start a new thread.
 *  Thread Starter [therealgilles](https://wordpress.org/support/users/chamois_blanc/)
 * (@chamois_blanc)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/rest-api-syntax-for-array-query-parameters/#post-12089043)
 * Thank you for the responses. Please remember to update the REST API documentation.
 *  [anoop911](https://wordpress.org/support/users/anoop911/)
 * (@anoop911)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/rest-api-syntax-for-array-query-parameters/#post-12268814)
 * Hello, I have the same issue. I’m trying to get the subscription with email=abc@gmail.
   com & Billing address fields = address_1,address_2,status
 * Im using the below
 * /wp-json/wc/v1/subscriptions?email=abc@gmail.com &_fields=address_1,address_2,
   status
 *  [anoop911](https://wordpress.org/support/users/anoop911/)
 * (@anoop911)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/rest-api-syntax-for-array-query-parameters/#post-12268817)
 * Here, address_1,address_2 is inside ;
 * “status”: “on-hold”,
    “billing”: { “first_name”: “”, “last_name”: “”, “company”:“
   sss”, “address_1”: “23232323”, “address_2”: “”, “city”: “”, “state”: “”, “postcode”:“”,“
   country”: “IN”, “email”: “abc@gmail.com”, “phone”: “9898989898” },

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘REST API: syntax for array query parameters’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [parameter](https://wordpress.org/support/topic-tag/parameter/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * 7 replies
 * 1 participant
 * Last reply from: [anoop911](https://wordpress.org/support/users/anoop911/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/rest-api-syntax-for-array-query-parameters/#post-12268817)
 * Status: resolved