Aslan Kaya
Aslan Kaya

Reputation: 524

eBay API call in PHP returns 'The item specific Brand is missing' error

My API integration with ebay started to give following error message:

[result] => 21919403: The item specific Brand is missing. Add Brand to this listing, enter a valid value, and then try again. )

I understand this has something to do with XML tags missing. I even tried to add the tag to this xml; it did not work:

$requestXmlBody .= "<ItemSpecifics> ";
foreach ($ebayApi_itemspecifics as $ebayApi_itemspecifickey=>$ebayApi_itemspecificvalue) {
    $requestXmlBody .= "<NameValueList><Name>" . str_replace('&', '&amp;', $ebayApi_itemspecifickey) . "</Name>
                        <Value>".$ebayApi_itemspecificvalue."</Value></NameValueList>";           
}

$requestXmlBody .= "  <NameValueList>
        <Name>Brand</Name>
        <Value>Navdari</Value>
    </NameValueList> 
  </ItemSpecifics>";

Upvotes: 2

Views: 4319

Answers (3)

user3284742
user3284742

Reputation: 23

Integrate ebay api getItemAspectsForCategory and get all aspects values required as well as optional for given category id. this way you can adjust your payload for offer create according to category.

Upvotes: 0

Andrei Susanu
Andrei Susanu

Reputation: 99

Here is the working solution:

$this->item->ProductListingDetails = new Types\ProductListingDetailsType();
$this->item->ProductListingDetails->UPC = 'Does not apply';

$this->item->ItemSpecifics = new Types\NameValueListArrayType();

$specific = new Types\NameValueListType();
$specific->Name = 'Brand';
$specific->Value[] = 'BrandValue';
$this->item->ItemSpecifics->NameValueList[] = $specific;

$specific = new Types\NameValueListType();
$specific->Name = 'MPN';
$specific->Value[] = 'MPNValue';
$this->item->ItemSpecifics->NameValueList[] = $specific;

Upvotes: 5

Nate M.
Nate M.

Reputation: 842

eBay has been converting many product categories over the past year to require UPC / Brand / MPN information on each listing. Luckily for sellers, there are default values that are allowed.

The best practices process you should use is the following:

  1. Get Category details to determine what fields are required. Use the GetCategoryFeatures call to obtain these details. Typically there are 4 identifiers which need to be handled:

    • UPC
    • MPN/Brand
    • ISBN
    • EAN

Once you determine what is missing for your listing (in this specific case, it appears you need brand), you can try applying the appropriate information in the Item Specifics (it looks like you have already tried this). If this doesn't work, you can attempt to load a default value. Again.. best practices are a bit more complicated but..

  1. Use the GeteBayDetails API call to retrieve DetailNameCodeType.ProductDetails. You are looking for the `ProductDetails.ProductIdentifierUnavailableText. This is the default text you can add into the ItemSpecifics to submit a listing with no branding.

Once all of this is done, you can simply insert the default text into your listing and give it a go. Typically for 'Brand', you just need to insert 'Unbranded'. I can say I have had some weird issues with hard coding the value. Occasionally I would have a listing fail with a UPC 'Does Not Apply' and if I retrieved the default text ('Does Not Apply') and set the UPC to the retrieved UPC default it worked perfectly. It may have to do with character set encording, especially since this is one of the things eBay requires you handle when getting an app certified (needs to be UTF-8 if I recall).

Unfortunately I use the .NET SDK for eBay so all of my code won't transfer directly to your issue, although it is the exact same problem. I would guess in your case that eBay simply doesn't recognize the brand you are trying to submit.

Upvotes: 3

Related Questions