Unable to update a product options

I am able to add options and variants creating a product:

POST

“options” => array(
“name” => “Color”,
“values” => array(
“Pink”,
“Red”,
),
“position” => 1,
),

“variants”=>array(
array(
“title”=> “Pink”,
“sku” => “A3POR44T”,
“option1”=> “Pinko”,
“inventory_quantity” => 11,
“price”=>20.00,
“taxable”=>false,
“inventory_management” => ‘shopify’
),
array(
“title”=> “Red”,
“sku” => “POR44T”,
“option1”=> “Redo”,
“inventory_quantity” => 14,
“price”=>23.00,
“taxable”=>false,
“inventory_management” => ‘shopify’
)
)

But if I PUT another option and variant to said product, instead it substitutes all the variants and option with the new one.

How do I update (add) instead?

Hi,

Use the add variant endpoint instead

Hello and thanks,

I tried it and I was able of course do add a variant to the product, I did in fact correctly create under the “Color” option automatically.

I did not indicate “Color” in any field of my POST. How did it know it was a value of the “Color” option?

What if I had 2 options? Or what If I had no options before?

Let’s say I have a product with no variants (I know it creates one titled “Default title”), how do I add a new Color/yellow variant?

Are you able to solve this? We have the same issue. It will be a great help if you share the solution.