title: WooCommerce REST API: updating product variation attributes sets attribute name and option to Any:Any
body: <p>So, I am making use of the endpoint <a href="https://woocommerce.github.io/woocommerce-rest-api-docs/?javascript#update-a-product-variation" rel="nofollow noreferrer">https://woocommerce.github.io/woocommerce-rest-api-docs/?javascript#update-a-product-variation</a>
  to update existing attributes of a variation. The attributes have been added in the product before using them for variation. But, updating the existing attribute to the values available is setting them to Any:Any (which means attributes have been overridden with an empty array) and on the webshop the product now can be purchased in any combination of the attributes.</p>
  <p>For ex.-
  Existing attributes on the product variation were:</p>
  <pre><code>[{&quot;name&quot;:&quot;Brand&quot;, &quot;options&quot;: &quot;Bare Denim&quot;},{&quot;name&quot;:&quot;Material&quot;, &quot;options&quot;: &quot;Cotton&quot;}]
  </code></pre>
  <p>and updating the attributes to one of the available options from <strong>Brand</strong> and <strong>Material</strong>:</p>
  <pre><code>[{&quot;name&quot;:&quot;Brand&quot;, &quot;options&quot;: &quot;Levis&quot;},{&quot;name&quot;:&quot;Material&quot;, &quot;options&quot;: &quot;Polyester&quot;}]
  </code></pre>
  <p>is making the variation attributes set to an empty array. Variation attributes after update:</p>
  <pre><code>[]
  </code></pre>
  <p>Is this the right way of updating product variation attributes? Can the attributes be updated this way or will have to create a new variation in this case?</p>