Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AddFixedPriceItem: Specify MPN in VariationSpecifics.NameValueList

Tags:

php

ebay-api

I'm updating some code which generates the XML for eBay listings, part of which is adding the MPN.

For single listings everything is working fine, as the brand and MPN can be specified through the ItemSpecifics container. For multi-variation listings however, the MPN must be specified for each variation.

According to the documentation, it should be specified in a variation's VariationSpecifics.NameValueList container.

I've added the code to do this, which generates the XML:

<Variation>
  <SKU>CODE</SKU>
  <StartPrice>99.99</StartPrice>
  <Quantity>124</Quantity>
  <VariationSpecifics>
    <NameValueList>
      <Name>MPN</Name>
      <Value>000001</Value>
    </NameValueList>
    <NameValueList>
      <Name>Choose Colour</Name>
      <Value>Black</Value>
    </NameValueList>
  </VariationSpecifics>
</Variation>

When sending a request to list the product, it fails, responding with the following errors:

[1] => Array
    (
        [ShortMessage] => Variation Specifics Mismatch.
        [LongMessage] => Variation Specifics provided does not match with the variation specifics of the variations on the item.
        [ErrorCode] => 21916664
        [SeverityCode] => Error
        [ErrorClassification] => RequestError
    )

[2] => Array
    (
        [ShortMessage] => Missing name in name-value list.
        [LongMessage] => Missing name in the variation specifics or variation specifics set.
        [ErrorCode] => 21916587
        [SeverityCode] => Error
        [ErrorClassification] => RequestError
    )

I assumed that I needed to provide each MPN in a VariationSpecificsSet.NameValueList container, having added that the listing was successful, but then the MPN appears as a selectable option on the listing itself, which is obviously incorrect:

listing shows mpn as selectable option

How do I correctly specify the MPN for multi-variation listings?

like image 709
billyonecan Avatar asked Nov 08 '22 20:11

billyonecan


1 Answers

I think you are confusing two separate concepts, and you can probably blame eBay's API naming conventions for that confusion. But, Item specifics is an informational field that is slapped onto the eBay listing, and Variation Specifics controls the visual aspect of the dropdown menus in a Multi-Variation listing.

Generally inside <VariationSpecificsSet>you will define the <Name> and <Value> tags. This only creates the visual drop-down menu view-able for customers on eBay.

Then you link those <Name> and <Value> tags to the <Name> and <Value> tags in <VariationSpecifics> on each variation. This will only fill in the visual drop-down created by <VariationSpecificsSet>. (The name/value tag in Variation Specifics must match a name/value tag in , otherwise you will get the errors that you are getting.

So as a solution, If you are using your MPN to as your unique ID, then you can fill it into the SKU field. But, if you are looking to simply add that field to the item specifics container, then you might want to just want to create an <ItemSpecifics> custom <Name> tag called "MPNs" and concatenate all of those MPN values in a comma separated list for the <Value>.

like image 140
Isaac Montaine Avatar answered Nov 14 '22 23:11

Isaac Montaine