i use getListingsItem see reference here
https://github.com/jlevers/selling-partner-api/blob/main/docs/Api/ListingsV20210801Api.md
I need to access the object Item.
use SellingPartnerApi\Api\SellersV1Api as SellersApi;
use SellingPartnerApi\Configuration;
use SellingPartnerApi\Endpoint;
$config = new Configuration([
"lwaClientId" => lwaClientId,
"lwaClientSecret" => lwaClientSecret,
"lwaRefreshToken" => lwaRefreshToken,
"awsAccessKeyId" => awsAccessKeyId,
"awsSecretAccessKey" => awsSecretAccessKey,
"endpoint" => Endpoint::EU // or another endpoint from lib/Endpoint.php
]);
$apiInstance = new SellingPartnerApi\Api\ListingsV20210801Api($config);
$seller_id = sellerId; // string | A selling partner identifier, such as a merchant account or vendor code.
$sku = 'xxxxxxxxxx'; // string | A selling partner provided identifier for an Amazon listing.
$marketplace_ids = marketplaceId; // string[] | A comma-delimited list of Amazon marketplace identifiers for the request.
$issue_locale = 'it_IT'; // string | A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: \"en_US\", \"fr_CA\", \"fr_FR\". Localized messages default to \"en_US\" when a localization is not available in the specified locale.
$included_data = 'issues,attributes,summaries,offers,fulfillmentAvailability';
try {
$result = $apiInstance->getListingsItem($seller_id, $sku, $marketplace_ids, $issue_locale, $included_data);
print_r( $result->getPayload() );
} catch (Exception $e) {
echo 'Exception when calling ListingsV20210801Api->getListingsItem: ', $e->getMessage(), PHP_EOL;
}
This code return: Uncaught Error: Call to undefined method SellingPartnerApi\Model\ListingsV20210801\Item::getPayload()
can someone help me?
thanks
getListingsItem working properly because on print_r i have the response