Using Magento 2, I'm trying to change Manage Stock attribute via rest API however does not seem to work via both the stockItems endpoint or the product one. Updating quantity seems to work fine.
Tried like below initially:
$url = "https://www.magestore.com/rest/all/V1/products/" . $sku;
$post_data = array(
'product' =>
array(
'sku' => $sku,
'extension_attributes' =>
array(
"stock_item" => array(
"qty" => $qty,
"is_in_stock" => $is_in_stock,
"manage_stock" => true
)
)
)
);
Then tried like this for the stockItems endpoint:
$url = "https://www.magestores.com/rest/V1/products/" . $sku . "/stockItems/1";
$post_data = array(
"stock_item" => array(
"qty" => $qty,
"is_in_stock" => $is_in_stock,
"manage_stock" => true
)
);
However neither seem to change manage stock to true for me, is this possible to achieve with Rest API?