php ile json formatındadata gönderimi yapıyorum ancak 1 noktada hata alıyorum sanırım json formatında olmadığı için bir hata,
aşağıdaki kod düzeni ile gönderdiğimde sıkıntı yok attributes kısmını eklediğimde hata veriyor
sanırım kod düzeninde bir sorun var, bilgisi olan arkadaşların yardımına ihtiyacım var..
aldığım hata bu : [message] => Could not read JSON document:
( trendyol api kullanarak ürün düzenleme işlemi yapmaya çalışıyorum )
$product['items'][] = array( 'barcode'=> $barcode, //'title'=> (string)$title, 'title'=> 'Rümeysa Tesettür Tunik - İndigo', 'productMainId' => (string)$productMainId, 'brandId' => (int)$brandId, 'categoryId' => (int)$pimCategoryId, 'quantity' => (int)$quantity, 'stockCode' => (string)$stockCode, 'dimensionalWeight' => 1, 'description' => $description, 'currencyType' => 'TRY', 'listPrice' => $listPrice, 'salePrice' => $salePrice, 'vatRate' => 8, 'cargoCompanyId' => 3 );yukarıdaki kısmı eklediğimde herşey tamam ama alttaki kod ile seçenekleri eklediğimde format uygun değil diyor
$product['items'][] = array(
'barcode'=> $barcode,
'title'=> $title,
'productMainId' => (string)$productMainId,
'brandId' => (int)$brandId,
'categoryId' => (int)$pimCategoryId,
'quantity' => (int)$quantity,
'stockCode' => (string)$stockCode,
'dimensionalWeight' => 1,
'description' => $description,
'currencyType' => 'TRY',
'listPrice' => $listPrice,
'salePrice' => $salePrice,
'vatRate' => 8,
'cargoCompanyId' => 3,
'attributes' => [
[
'attributeId' => 338,
'attributeValueId' => $size,
],
[
'attributeId' => 343,
'attributeValueId' => 4295,
],
[
'attributeId' => 47,
'attributeValueId' => $color,
],
]
);