Title: Error: Invalid parameter(s): image
Last modified: March 28, 2018

---

# Error: Invalid parameter(s): image

 *  Resolved [apb1963](https://wordpress.org/support/users/apb1963/)
 * (@apb1963)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/error-invalid-parameters-image/)
 * $ wp wc product_cat update 41 –image=12266.jpg
    Error: Invalid parameter(s): 
   image {“status”:400,”params”:{“image”:”image is not of type object.”}}
 * I’m not sure what that’s telling me, as a user. The only thing I can think of
   is the file either doesn’t exist, or is corrupt. Clearly, it exists:
    $ ls -l/
   data/local/src/dragon.greetonix.com/wp-content/uploads/2018/03/12266.jpg -rw-
   rw-r– 1 apb apb 201392 Mar 21 12:58 /data/local/src/dragon.greetonix.com/wp-content/
   uploads/2018/03/12266.jpg
 * And since I’m using the same image for both product and category, I can see that
   the image is fine as a product, so clearly it’s not corrupt.
 * So, I’m stuck as to what the issue is. Any help?
 * Thanks in advance!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-invalid-parameters-image%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [8 years, 2 months ago](https://wordpress.org/support/topic/error-invalid-parameters-image/#post-10129320)
 * It’s looking for an object. So this if the image ID already exists on your site:
 * `wp wc product_cat update 36 --image="{id: 186}" --user=1`
 * Or this if is is offsite and needs to be imported:
 * `wp wc product_cat update 36 --image="{src: 'https://example.dev/path/to/image.
   png'}" --user=1`
    -  This reply was modified 8 years, 2 months ago by [Caleb Burks](https://wordpress.org/support/users/icaleb/).
 *  Thread Starter [apb1963](https://wordpress.org/support/users/apb1963/)
 * (@apb1963)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-invalid-parameters-image/#post-10143179)
 * Thank you for that, I presume it will work though I’ve yet to get through it.
   Working on getting the image ID after the fact and running into issues.
 * Also, please note, the documentation states:
 * > –image
   > Image data.
 * Which is less than useful. There’s no possible way to get from what’s written
   in the docs to your provided solution; until now.
 *  [wideeyed](https://wordpress.org/support/users/wideeyed/)
 * (@wideeyed)
 * [8 years ago](https://wordpress.org/support/topic/error-invalid-parameters-image/#post-10345471)
 * Caleb, neither of those methods worked for me.
 * I uploaded the image to the media library and grabbed it’s id from the URL in
   the Attachment Details. I then used the id of the product category, again from
   the URL.
 * This was my command:
 * `wp wc product_cat update 134 --image="{id: 9975'}" --user=1`
 * And WP CLI reported: `Success: Updated product_cat 134.`
 * When I refresh the product categories page, or edit that category, the new image
   isn’t there.
 * I’ve also got to agree with apb1963. The documentation is really in need of some
   examples and additional detail.

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

The topic ‘Error: Invalid parameter(s): image’ 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

 * [invalid parameter](https://wordpress.org/support/topic-tag/invalid-parameter/)
 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * 3 replies
 * 3 participants
 * Last reply from: [wideeyed](https://wordpress.org/support/users/wideeyed/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/error-invalid-parameters-image/#post-10345471)
 * Status: resolved