0

I want to add an attribute to a product using rest api. I have created the attribute but not added to the product.

How can i add it to respective product using rest api?

  • How did You added the attribute to product @avesh – Learing_Coder Jun 15 '18 at 15:49
  • I created attribute in using store->attribute->product – Avesh Naik Jun 15 '18 at 15:59
0

Never mind i found the solution.

           $data = array(
                "product" => array(
                    'custom_attributes' => array(
                        array( 'attribute_code' => 'useful',   
                           'value' => 1),
                    ),
                )
            );

            $apiClient->put("products/".$product->sku, $data);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.