Open greenhof opened 6 days ago
The value typically has to be a nested array, because there are some attributes that can have multiple values. Give this a shot:
$data = new ListingsItemPatchRequest(
$productType,
[
new PatchOperation(
'replace',
'/attributes/country_of_origin',
[[
'value' => $cocs[$sku],
'marketplace_id' => $mplaceKurz[$code],
]]
),
]
);
$patchresult = $listingsItemsApi->patchListingsItem('A2XXXXXXX', $sku, $data, [$mplaceKurz[$code]]);
Problem description:
I am banging my head on replacing country_of_origin attribute on multiple listings. Could you please take a look at my code and point me in the right direction?
Error:
Code
here is the generated request body:
SellingPartnerApi\Seller\ListingsItemsV20210801\Dto\ListingsItemPatchRequest Object ( [productType] => BEAUTY [patches] => Array ( [0] => SellingPartnerApi\Seller\ListingsItemsV20210801\Dto\PatchOperation Object ( [op] => replace [path] => /attributes/country_of_origin [value] => Array ( [value] => DE [marketplace_id] => AMEN7PMS3EDWL )
)