Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetListingItem -> Summaries -> ItemName not required #835

Open
salyangoz opened this issue Dec 25, 2024 · 2 comments
Open

GetListingItem -> Summaries -> ItemName not required #835

salyangoz opened this issue Dec 25, 2024 · 2 comments

Comments

@salyangoz
Copy link

salyangoz commented Dec 25, 2024

Problem description:

Hello, for getListingItem function sometimes summaries -> itemName is returning null. So we think that this field is not need to be required instead it needs to be optional. I know it's weird for Amazon not return itemName, but for this log error we know that ietm name can be nullable.

Error:

# ArgumentCountError: SellingPartnerApi\Seller\ListingsItemsV20210801\Dto\ItemSummaryByMarketplace::__construct(): Argument #5 ($itemName) not passed

Code

return $service->getListingsItem(
            $sellerId,
            $sku,
            [$this->getMarketplaceId()],
            null,
            ['summaries,attributes,issues,offers,fulfillmentAvailability']
        )->dto();

Seller Central SP API config page screenshot

Screenshot 2024-12-25 at 20 11 12

itemName is not returning example
Response
{ "sku": "xxx", "summaries": [ { "marketplaceId": "xxx", "asin": "xx", "productType": "PRODUCT", "conditionType": "new_new", "status": [ "DISCOVERABLE" ], "createdDate": "2023-02-02T11:40:55.495Z", "lastUpdatedDate": "2023-11-25T07:54:48.062Z" } ] }

@gwharton
Copy link

gwharton commented Jan 5, 2025

Also experiencing this. I have 2 items that refuse to return itemName in the summaries section. Interestingly if I look at the item in the Inventory page on seller central, the Title of the product is missing the link to view it on amazon.

As soon as you call ->dto() on the response object everything bugs out as itemName is required.

I'm wondering if it will pick up the item_name attribute eventually and amazon start populating the itemName summaries field on its own and the problem will go away.

Edit : in my case it is broken on both searchListingsItems and getListingsItem calls.

Edit : I don't know if it is related, but the two items that are refusing to supply itemName summaries fields, were flagged overnight for Prescription Only Medicine violations, despite them being Industrial Oils listed in the MACHINE_LUBRICATION product type.

@gwharton
Copy link

gwharton commented Jan 6, 2025

I'm working around this with the following patch. It makes the itemName field optional. If it is returned by amazon, it is populated. If it isn't returned by amazon, it is populated as null.

I just make sure that wherever I use the itemName field, I check it is not null before use.

--- src/Seller/ListingsItemsV20210801/Dto/ItemSummaryByMarketplace.orig.php	2025-01-06 09:22:52.583277196 +0000
+++ src/Seller/ListingsItemsV20210801/Dto/ItemSummaryByMarketplace.php	2025-01-06 09:23:41.955331424 +0000
@@ -31,9 +31,9 @@
         public string $asin,
         public string $productType,
         public array $status,
-        public string $itemName,
         public \DateTimeInterface $createdDate,
         public \DateTimeInterface $lastUpdatedDate,
+        public ?string $itemName = null,
         public ?string $conditionType = null,
         public ?string $fnSku = null,
         public ?ItemImage $mainImage = null,

Need to really understand under what circumstances the itemName field is not populated and why. Is it an error on Amazon's part, or is it really optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants