Product attribute overwrite with empty value

Hi all,
How can I overwrite an attribute string value with an empty value?
I've tried an empty string but I receive the following error:
Response body:
{"error":{"code":400,"method":"UPDATE","request":"\/nl\/products\/113033667\/attributes.json","message":"Invalid data input."}}
Seems like the data is invalid.
Request body:
"productAttributes" => [
{
"id" => 764566,
"value" => ""
},
{
"id" => 763765,
"value" => "Test value"
}
]
})
What is the correct way to make an attribute field empty?
Thanks,
Kindest regards,
Dirk
Best Answer
-
LucienVersendaal Moderator, Lightspeed Staff Posts: 991 moderator
Hi @DirkAVA,
Thank you for contacting us.
You need to specify in your URL which attribute you want to update. So your URL will look like.
PUT /products/{product_id}/attributes/{productAttribute_id}.json //Payload { "productAttribute" : { "value": "New Value" } }
More information here: https://developers.lightspeedhq.com/ecom/endpoints/productattribute/#put-update-a-product-attribute
I hope this helps.
Answers
Thanks Lucien!