Skip to main content
Published: April 23 2015, 2:58:00 PMUpdated: August 09 2022, 11:11:34 AM

What is the flow for listing items with variations?

Detailed Description

The best place to get information about variations is from the following documents:

Overview: http://developer.ebay.com/devzone/guides/ebayfeatures/Development/Variations.html

Samples: http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/AddFixedPriceItem.html#Samples


Here is a flow for a listing a single item:
1. Determine if the category that you are interested in supports variations by using GetCategoryFeatures.

Sample request for a UK category:

<?xml version="1.0" encoding="utf-8"?>
<GetCategoryFeaturesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <DetailLevel>ReturnAll</DetailLevel>
  <ViewAllNodes>true</ViewAllNodes>
  <RequesterCredentials>
    <eBayAuthToken>*****</eBayAuthToken>
  </RequesterCredentials>
  <CategoryID>57991</CategoryID>
</GetCategoryFeaturesRequest>

In the response, if you see VariationsEnabled as true,  then the category supports variations.

2. Determine the recommended item specifics for the category using getItemAspectsForCategory.

Sample request:

https://api.ebay.com/commerce/taxonomy/v1/category_tree/3/get_item_aspects_for_category?category_id=57991

You will see attributes such as size, style, colour, brand etc. Use whatever is applicable to your item and optionally add whatever would describe your item better. Some of these attributes will be part of your item specifics such as brand; and some as variations, such as colour. The attributes that have the value for VariationSpecifics as disabled can only be used as item specifics and not as variations.

3. List the item with item specifics and variations as appropriate using AddFixedPriceItem.

Sample request:

<?xml version="1.0" encoding="utf-8"?>
<AddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <Item>
  <Country>GB</Country>
  <Currency>GBP</Currency>
  <Description>Description</Description>
 
<DispatchTimeMax>3</DispatchTimeMax>
  <ListingDuration>GTC</ListingDuration>
  <ListingType>FixedPriceItem</ListingType>
  <PaymentMethods>PayPal</PaymentMethods>
  <PayPalEmailAddress>test@test.com</PayPalEmailAddress>
  <PostalCode>SE6 1AL</PostalCode>
  <PrimaryCategory>
    <CategoryID>57991</CategoryID>
  </PrimaryCategory>
  <Title>New Ralph Lauren Polo shirt Pink Black Blue Yellow</Title>
  <PictureDetails>
    <PictureURL>http://i12.ebayimg.com/03/i/04/8a/5f/a1_1_sbl.JPG</PictureURL>
  </PictureDetails>
  <ReturnPolicy>
    <ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
    <Description>Text description of return policy details</Description>
    <ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
  </ReturnPolicy>
  <ShippingDetails>
    <ShippingServiceOptions>
      <ShippingService>UK_RoyalMailFirstClassStandard</ShippingService>
      <ShippingServiceCost>0</ShippingServiceCost>
      <ShippingServiceAdditionalCost>0</ShippingServiceAdditionalCost>
      <ShippingServicePriority>1</ShippingServicePriority>
    </ShippingServiceOptions>
  </ShippingDetails>
  <ItemSpecifics>
    <NameValueList>
      <Name>Brand</Name>
      <Value>Ralph Lauren</Value>
    </NameValueList>
    <NameValueList>
      <Name>Style</Name>
      <Value>Polo Shirt</Value>
    </NameValueList>
    <NameValueList>
      <Name>Condition</Name>
      <Value>New: With Tags</Value>
    </NameValueList>
  </ItemSpecifics>
  <Variations>
    <VariationSpecificsSet>
      <NameValueList>
        <Name>Size</Name>
        <Value>XS</Value>
        <Value>XL</Value>
      </NameValueList>
      <NameValueList>
        <Name>Colour</Name>
        <Value>Pink</Value>
        <Value>Blue</Value>
      </NameValueList>
    </VariationSpecificsSet>
    <Variation>
      <SKU>12345</SKU>
      <StartPrice>17.99</StartPrice>
      <Quantity>4</Quantity>
      <VariationSpecifics>
        <NameValueList>
          <Name>Colour</Name>
          <Value>Pink</Value>
        </NameValueList>
        <NameValueList>
          <Name>Size</Name>
          <Value>XS</Value>
        </NameValueList>
      </VariationSpecifics>
    </Variation>
    <Variation>
      <SKU>12346</SKU>
      <StartPrice>17.99</StartPrice>
      <Quantity>8</Quantity>
      <VariationSpecifics>
        <NameValueList>
          <Name>Colour</Name>
          <Value>Blue</Value>
        </NameValueList>
        <NameValueList>
          <Name>Size</Name>
          <Value>XL</Value>
        </NameValueList>
      </VariationSpecifics>
    </Variation>
    <Pictures>
      <VariationSpecificName>Colour</VariationSpecificName>
        <VariationSpecificPictureSet>
          <VariationSpecificValue>Pink</VariationSpecificValue>
          <PictureURL>http://i12.ebayimg.com/03/i/04/8a/5f/a1_1_sbl.JPG</PictureURL>
        </VariationSpecificPictureSet>
        <VariationSpecificPictureSet>
          <VariationSpecificValue>Blue</VariationSpecificValue>
          <PictureURL>http://i22.ebayimg.com/01/i/04/8e/53/69_1_sb2.JPG</PictureURL>
        </VariationSpecificPictureSet>
      </Pictures>
    </Variations>
  </Item>
  <RequesterCredentials>
    <eBayAuthToken>*****</eBayAuthToken>
  </RequesterCredentials>
</AddFixedPriceItemRequest>

For listing items in bulk across categories, it is not efficient to make the call to GetCategoryFeatures and getItemAspectsForCategory for each category.  You should take advantage of calls being able to return information for multiple categories. 

For GetCategories, do not specify the CategoryID in the request.
For getItemAspectsForCategory, you can send in one CategoryID or consider using downloadFile API call.


 

 

How well did this answer your question?
Answers others found helpful

Got thoughts? Click the feedback button – your insights help us improve!