I am trying to add product using Rest API. Adding product is working fine.
But I am facing issue in assign in the product information only for Default values instead of copying data for store view. When we select store view Use Default Value
checkbox must be checked. Only one attribute value must save in database with scope 0 instead of copying same values for each store.
How can I achieve the above scenario using Rest API ? Below is what I have tried so far:
Case 1:
I tried to call API using the below URL, But It replicate the product values for store view.
POST /rest/V1/products
Case 2:
I tried to call API using the below URL, But It also replicate the product values for store view.
POST /rest/{store_code}/V1/products
Case 3:
I tried to call API using the below URL
POST /rest/all/V1/products
using the above website not assigned to product. so I called catalogProductWebsiteLinkRepositoryV1
to assign product in website as below, but it also replicate the product values for store view.
POST /rest/V1/products/{sku}/websites
Please suggest how can we save product data for global scope only ?
Note: only have one website, one store and one store view in magento installtion.
$product->setStoreId(0); $product->setMyAttribute(123); $product->save();