Answer the question
In order to leave comments, you need to log in
What is wrong with generating json?
I update the balances on valberis by api I form an
array
$item_data = array(
'0' => array(
'barcode' => '656334e3564439',
'stock' => '1',
'warehouseId' => '7543'
)
$data = json_encode($item_data);
$data = '[{"barcode":"656334e3564439","stock":1,"warehouseId":7543}]';
Answer the question
In order to leave comments, you need to log in
The string key 0 is not needed.
Or string values where they should be numeric.
You need to look at the wildberries documentation.
But if you have an example of a working json, then it is formed like this:
$item_data = [
[
'barcode' => '656334e3564439',
'stock' => 1,
'warehouseId' => 7543,
]
];
$data = json_encode($item_data);
[{"barcode":"656334e3564439","stock":"1","warehouseId":"7543"}]
[{"barcode":"656334e3564439","stock":1,"warehouseId":7543}]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question