code:
$inventory = "http://example.com/index.php/rest/V1/stockStatuses/".$products_object->sku;
$ch1 = curl_init($inventory);
curl_setopt($ch1, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch1, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token)));
$stock_item = json_decode(curl_exec($ch1));
debug:
object(stdClass)#28 (5) {
["product_id"]=> int(259)
["stock_id"]=> int(1)
["qty"]=> int(103)
["stock_status"]=> int(0)
["stock_item"]=> object(stdClass)#29 (26) {
["item_id"]=> int(259)
["product_id"]=> int(259)
["stock_id"]=> int(1) ["qty"]=> int(103)
["is_in_stock"]=> bool(false)
["is_qty_decimal"]=> bool(false)
["show_default_notification_message"]=> bool(false)
["use_config_min_qty"]=> bool(true)
["min_qty"]=> int(0)
["use_config_min_sale_qty"]=> int(1)
["min_sale_qty"]=> int(1)
["use_config_max_sale_qty"]=> bool(true)
["max_sale_qty"]=> int(10000)
["use_config_backorders"]=> bool(true)
["backorders"]=> int(0)
["use_config_notify_stock_qty"]=> bool(true)
["notify_stock_qty"]=> int(1)
["use_config_qty_increments"]=> bool(true)
["qty_increments"]=> int(0)
["use_config_enable_qty_inc"]=> bool(true)
["enable_qty_increments"]=> bool(false)
["use_config_manage_stock"]=> bool(true)
["manage_stock"]=> bool(true)
["low_stock_date"]=> NULL
["is_decimal_divided"]=> bool(false)
["stock_status_changed_auto"]=> int(0)
}
}
if i want to update a product from "no stock" to a positive interger, which one of them i need to update actually?