user3085354
user3085354

Reputation: 21

eBay API call AddItem using item's UPC code

I want to add products using AddItem API call in eBay with UPC code. I have searched about it, but did not get any specific answer. I want to ask what will be the UPC code for item that will be added in to the eBay list.

Please help me.

Thanks & Regards

Upvotes: 2

Views: 663

Answers (2)

shankar kanase
shankar kanase

Reputation: 107

For some Ebay Categories it is mandatory to add UPC field. If you don't have UPC code you can simply pass this:

<ProductListingDetails>
      <UPC>Does not apply</UPC>
    </ProductListingDetails>

Upvotes: 0

drshock
drshock

Reputation: 2126

This is an old question, and surely you have moved on. But surprisingly no other related examples here on stackoverflow or at developer.ebay.com were to be found when I ran into a similar need with the eBay API AddFixedPriceItem (almost exactly identical to AddItem but aimed at non-auction listings). Here is the XML request structure that worked for me in POSTing to this API for UPC or ISBN coded products illustrated using the Verify version of the API:

<?xml version="1.0" encoding="utf-8"?>
<VerifyAddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
  <eBayAuthToken>YOUR TOKEN STRING HERE</eBayAuthToken>
</RequesterCredentials>
<Item>
  <AutoPay>false</AutoPay>
  <Country>US</Country>
  <Currency>USD</Currency>
  <ListingType>FixedPriceItem</ListingType>
  <ListingDuration>Days_30</ListingDuration>
  <PaymentMethods>PayPal</PaymentMethods>
  <PaymentMethods>VisaMC</PaymentMethods>
  <PayPalEmailAddress>SELLER PAYPAL EMAIL ADDR HERE</PayPalEmailAddress>
  <ProductListingDetails>
    <UPC>BARCODE HERE</UPC>
    <EAN>Does not apply</EAN>
    <ListIfNoProduct>true</ListIfNoProduct>
    <UseStockPhotoURLAsGallery>true</UseStockPhotoURLAsGallery>
  </ProductListingDetails>
  <ShippingDetails>
    <ShippingServiceOptions>
      <ShippingService>USPSFirstClass</ShippingService>
      <ShippingServiceCost currencyID="USD">3.00</ShippingServiceCost>
      <ShippingServiceAdditionalCost>1.00</ShippingServiceAdditionalCost>
      <ShippingServicePriority>1</ShippingServicePriority>
      <ShippingService>USPSPriority</ShippingService>
      <ShippingServiceCost currencyID="USD">5.00</ShippingServiceCost>
      <ShippingServiceAdditionalCost>2.00</ShippingServiceAdditionalCost>
      <ShippingServicePriority>2</ShippingServicePriority>
    </ShippingServiceOptions>
    <ShippingType>Flat</ShippingType>
  </ShippingDetails>
  <ShipToLocations>US</ShipToLocations>
  <Quantity>1</Quantity>
  <Site>US</Site>
  <StartPrice currencyID="USD">1.99</StartPrice>
  <Title>YOUR GREAT ITEM TITLE</Title>
  <Location>CITY,STATE HERE</Location>
  <PictureDetails>
    <GalleryType>Gallery</GalleryType>
  </PictureDetails>
  <DispatchTimeMax>3</DispatchTimeMax>
  <ReturnPolicy>
    <RefundOption>MoneyBack</RefundOption>
    <Refund>Money Back</Refund>
    <ReturnsWithinOption>Days_30</ReturnsWithinOption>
    <ReturnsWithin>30 Days</ReturnsWithin>
    <ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
    <ReturnsAccepted>Returns Accepted</ReturnsAccepted>
    <ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
    <ShippingCostPaidBy>Buyer</ShippingCostPaidBy>
  </ReturnPolicy>
  <ConditionID>EBAY CONDITION CODE</ConditionID>
  <ConditionDisplayName>EBAY CONDITION DISPLAY TEXT</ConditionDisplayName>
</Item>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>Low</WarningLevel>
</VerifyAddFixedPriceItemRequest>

This is the VerifyAddFixedPriceItem call, which again is very very similar to the VerifyAddItem API. You can use the Verify version of either to check out that the request will be OK once debugged (just don't trust the fees either of them report even in production). The AddFixedPriceItem API adds the item to eBay using the UPC code only, via the eBay product catalog content. You can replace <UPC> and </UPC> with <ISBN> and </ISBN> for books as well. You could use this as an XML template for the VerifyAddItem and AddItem APIs as well.

Text in CAPS needs to be customized, the shipping prices are just random for illustration. I ran this using eBay Trading API version 1001 (as of this posting date you can ignore the warnings about no seller profile being in place). Also you can find the eBay condition codes and name text here: eBay Condition ID Values and Names Hope this helps you or someone else that comes along with a similar need.

Upvotes: 1

Related Questions