i’am bulding s small webapp with PHP and jlevers/selling-partner-api (https://github.com/jlevers/selling-partner-api).
i need to recover the ASIN starting from EAN code.
i have try this:
$catalogApi = $connector->catalogItems();
try {
// EAN code of a product
$ean = '3578830113254';
$marketplaceId = 'APJ6JRA9NG5V4';
$includedData = ["summaries", "images", "salesRanks", "productTypes", "identifiers", "variations"];
//search EAN
$response = $catalogApi->searchCatalogItems([
'marketplaceIds' => [$marketplaceId],
'identifiersType' => 'EAN',
'identifiers' => [$ean],
'includedData' => $includedData
]);
// Visualizza la risposta
echo "<pre>";
print_r($response);
echo "</pre>";
} catch (Exception $e) {
// Gestisci gli errori
echo "Errore: ";
var_dump($e->getMessage());
}
but i recive this strange error:
SellingPartnerApiSellerCatalogItemsV20220401Api::getCatalogItem(): Argument #1 ($asin) must be of type string, array given