I have two stores and want to set the "Use Default Value" option for the cost field when its value is empty. This is functioning correctly in the admin panel. How can I achieve this using the API with the following endpoint:
http://test.com/rest/en_UK/V1/products/sku?
enter image description here
1 Answer 1
Here you just have to play with the scopes for this.
In this case, you need to call twice to the API, with different scopes. If you want an specific element on the storeview not defined at that scope, leave it blank and add the "use_default" property on true:
PUT http://test.com/rest/en_UK/V1/products/:sku
{
"product": {
"sku": "your-product-sku",
"custom_attributes": [
{
"attribute_code": "cost",
"value": "",
"use_default": true
}
]
}
}
-
Thank you Serfe!Hafiz Arslan– Hafiz Arslan2024年10月25日 09:31:15 +00:00Commented Oct 25, 2024 at 9:31
Explore related questions
See similar questions with these tags.