$item_data = array(
'0' => array(
'barcode' => '656334e3564439',
'stock' => '1',
'warehouseId' => '7543'
)
$data = json_encode($item_data);
$data = '[{"barcode":"656334e3564439","stock":1,"warehouseId":7543}]';
$item_data = [
[
'barcode' => '656334e3564439',
'stock' => 1,
'warehouseId' => 7543,
]
];
$data = json_encode($item_data);