Unable to add item on eBay API due to Item Specific Type missing - ebay-api

We are getting the following error when calling the eBay AddItemRequest API
The item specific Type is missing. Add Type to this listing, enter a valid value, and then try again.21919303
<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>XXXXXXXXXXX</eBayAuthToken>
</RequesterCredentials>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<Item>
<Title>test-800</Title>
<Description>test 800</Description>
<PrimaryCategory>
<CategoryID>176971</CategoryID>
</PrimaryCategory>
<StartPrice>200</StartPrice>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<ConditionID>1000</ConditionID>
<Country>US</Country>
<Currency>USD</Currency>
<DispatchTimeMax>3</DispatchTimeMax>
<ListingDuration>GTC</ListingDuration>
<ListingType>FixedPriceItem</ListingType>
<PictureDetails>
<GalleryType>Gallery</GalleryType>
<PictureURL>https://eznetcrm.net/img/eZnetLogo.png</PictureURL>
</PictureDetails>
<PostalCode>32746</PostalCode>
<ProductListingDetails>
<UPC></UPC>
<BrandMPN>
<Brand>HP</Brand>
<MPN>845418-B21</MPN>
</BrandMPN>
<IncludeStockPhotoURL>true</IncludeStockPhotoURL>
<IncludePrefilledItemInformation>true</IncludePrefilledItemInformation>
<UseFirstProduct>true</UseFirstProduct>
<UseStockPhotoURLAsGallery>true</UseStockPhotoURLAsGallery>
<ReturnSearchResultOnDuplicates>true</ReturnSearchResultOnDuplicates>
</ProductListingDetails>
<Quantity>5</Quantity>
<ItemSpecifics>
<NameValueList>
<Name>Brand</Name>
<Value>HP</Value>
</NameValueList>
<NameValueList>
<Name>MPN</Name>
<Value>845418-B21</Value>
</NameValueList>
</ItemSpecifics>
<ReturnPolicy>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<RefundOption>MoneyBack</RefundOption>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>USPSMedia</ShippingService>
<ShippingServiceAdditionalCost>0</ShippingServiceAdditionalCost>
<ShippingServiceCost>0</ShippingServiceCost>
</ShippingServiceOptions>
</ShippingDetails>
<Site>US</Site>
</Item>
</AddItemRequest>
We are trying to add an item using the above XML through eBay APIs but are unable to do so. What we are doing wrong in XML format? Also, we have added specific data as we got an error.

When adding ItemSpecifics, you will need to check if there are any ItemSpecific entries that are mandatory for your CategoryID. This can be checked from the GetCategorySpecifics API.
In your case, the category ID is 176971 and in the XML payload, there are two existing ItemSpecifics: Brand and MPN. As suggested by the error message you are getting and confirming from the GetCategorySpecifics API on eBay, it is evident that you need to add an ItemSpecific with the name Type within your ItemSpecifics. After doing that, your ItemSpecifics should look like this:
<ItemSpecifics>
<NameValueList>
<Name>Brand</Name>
<Value>HP</Value>
</NameValueList>
<NameValueList>
<Name>Type</Name>
<Value>CustomTypeNameHere</Value>
</NameValueList>
<NameValueList>
<Name>MPN</Name>
<Value>845418-B21</Value>
</NameValueList>
</ItemSpecifics>
You can verify the call using the VerifyAddItemResponse API once you add the Type ItemSpecific.
In general, to figure out what ItemSpecifics are needed for a given CategoryId, you can refer to the following documentation (Listing with Required Item Specifics. However, very briefly, to determine which item specifics are required, call GetCategorySpecifics to retrieve the item specifics recommendations for the category you're listing in. In the response, look for these fields for each recommendation:
This item specific name is required for the category: Recommendations.NameRecommendation.ValidationRules.MinValues
You can only use one of these values that eBay has defined (as returned in the response): Recommendations.NameRecommendation.ValidationRules.SelectionMode=SelectionOnly

Related

Error while creating new data file in HP-Exstream

I am trying to create a data file for my application with XML as input and map it to my HP Exstream variables. But when I am trying to save the file it is giving me error "No customer-level tag specified! Engine will not process.". I am not sure how to resolve this error. There is no customer level information I want in my input. Can anyone explain what is this error and how to resolve it?
What HP Exstream is telling you is that you have not defined a tag that will allow Exstream to know when a customer begins and ends. This does not have to be a tag that says <customer-level>, but rather the tag you are using in the XML to determine where a customer begins and ends.
When you are using an XML file as input, you may be dealing with multiple customers take this for example:
<item>
<address>
<line>a</line>
<line>b</line>
</address>
<body>Hello World</body>
</item>
<item>
<address>
<line>c</line>
<line>d</line>
</address>
<body>Hello Universe</body>
</item>
I would be using the <item> tag to tell HP Exstream where my customer begins and ends.
You can choose the customer tag in the properties of the tags.

Is there any existing service in HotDocs tools to receive data from an external source to prepare a document?

HotDocs is a tool to generate documents and basically it carries 2 things. First is temple and second is answer file. Template carries variables and data to those variables are pushed through answer file.
Generally answer file is page where is it asks for data and further it generates a document.
Now our requirement is - instead of passing variable's values through answer file, I need to send through a API built using PHP which provides data in JSON format.
IS there any exiting service in HotDocs to serve this kind requests?. I can change the data from JSON to XML if required.
At the moment there is no off the shelf converter from JSON to HotDocs Answer XML however, at HotDocs we do this all the time. If you produce either JSON or XML from your application the data will need to be transformed into the HotDocs answer XML format - e.g.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AnswerSet title="Demo Answers" version="1.1">
<Answer name="Employee Name">
<TextValue>Graham Penman</TextValue>
</Answer>
<Answer name="Job Duty">
<RptValue>
<TextValue>make tea</TextValue>
<TextValue>make coffee</TextValue>
<TextValue>make some cake</TextValue>
</RptValue>
</Answer>
<Answer name="Annual Salary">
<NumValue>12.0000000</NumValue>
</Answer>
<Answer name="Contract Date">
<DateValue>10/10/2016</DateValue>
</Answer>
<Answer name="Paid Seminar Days">
<TFValue>false</TFValue>
</Answer>
</AnswerSet>
There are three key things you need to know to create the answer XML: The data type of your data, the data type in HotDocs and whether the data you are passing is a list or single item.
So to build the answer XML is relatively easy.
The answer XML is essentially key value pairs being contained between the opening and closing tags:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AnswerSet title="Demo Answers" version="1.1">
...Answers go here
</AnswerSet>
We then add answers in by adding the following and specifying the variable in the template the answer corresponds to, the actual value (from your data) you want to set the answer to and also the type of data it is in the template - in the example below it is text however, the type in HotDocs are: TextValue (string), NumValue (decimal), TFValue (boolean), DateValue (DateTime) and MCValue (see later on in this answer).
<Answer name="[Variable name in template]">
<TextValue>[Value from your data]</TextValue>
</Answer>
For multiple choices specifically you can select one or more answers so the answer XML format is slightly different:
<Answer name="[Variable name in template]">
<MCValue>
<SelValue>[First selected value]</SelValue>
<SelValue>[Second selected value]</SelValue>
</MCValue>
</Answer>
If you have repeated data you want to put into the document you can use the list repeat format:
<Answer name="[Variable name in template]">
<RptValue>
<[Variable Type]>[First value]</[Variable Type]>
<[Variable Type]>[Second value]</[Variable Type]>
</RptValue>
</Answer>
Once you build this XML structure you can pass this into the assemble document method on the REST services as a string with the template to assemble the corresponding documents.

How to Obtain (Extract) eBay Listing EAN which is not Visible (multi-variation listing?

wanted to know if there's a way to obtain the ean used by seller for a product listing on eBay, the ean does currently show up on eBay's item specifics area if its a multi-variation listing (only shows up if its a single product listing), so is there a way to obtain the ean used for a listing, here's an example of a listing which I would like to obtain the ean used: http://www.ebay.co.uk/itm/Luxury-Magnetic-Flip-Cover-Stand-Wallet-Leather-Case-For-Apple-iPhone-Models-/172423423931?var=&hash=item28253ca7bb:m:mUL-SeQQB128hGq-rt62LJw
You can call the GetItem operation in the Trading API. Below is an example XML request.
<?xml version="1.0" encoding="UTF-8"?>
<GetItemRequest
xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken></eBayAuthToken>
</RequesterCredentials>
<ItemID>172423423931</ItemID>
<OutputSelector>Item.Variations.Variation.VariationProductListingDetails.EAN</OutputSelector>
</GetItemRequest>
A sample of the response from the API is below. The EAN information is contained in the Item.Variations.Variation.VariationProductListingDetails.EAN field.
<?xml version="1.0" encoding="UTF-8"?>
<GetItemResponse
xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2017-02-17T10:12:13.699Z</Timestamp>
<Ack>Success</Ack>
<Version>991</Version>
<Build>E991_CORE_API_18167430_R1</Build>
<Item>
<Variations>
<Variation>
<VariationProductListingDetails>
<EAN>0702865347275</EAN>
</VariationProductListingDetails>
</Variation>
<Variation>
<VariationProductListingDetails>
<EAN>0702865347275</EAN>
</VariationProductListingDetails>
</Variation>
</Variations>
</Item>
</GetItemResponse>

eBay CompleteSale API giving error in response

I am using the following xml for eBay CompleteSale API call:
<?xml version="1.0" encoding="utf-8"?>
<CompleteSaleRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>$auth_token</eBayAuthToken>
</RequesterCredentials>
<ItemID>$itemId</ItemID>
<TransactionID>$transId</TransactionID>
<FeedbackInfo>
<CommentText> string </CommentText>
<CommentType>Positive</CommentType>
<TargetUser></TargetUser>
</FeedbackInfo>
<Shipped>1</Shipped>
<Paid>1</Paid>
<ListingType>Half</ListingType>
<Shipment>
<ShipmentTrackingDetails>
<ShipmentTrackingNumber>$trackingNo</ShipmentTrackingNumber>
<ShippingCarrierUsed>$carrier</ShippingCarrierUsed>
</ShipmentTrackingDetails>
<ShippedTime>$shippingDate</ShippedTime>
</Shipment>
<ErrorLanguage> string </ErrorLanguage>
<MessageID> string </MessageID>
<Version>889</Version>
<ErrorHandling>BestEffort</ErrorHandling>
<WarningLevel>Low</WarningLevel>
</CompleteSaleRequest>
When I run the script, the tracking number gets updated in the eBay correctly, but the response XML gives error:
<?xml version="1.0" encoding="UTF-8"?>
<CompleteSaleResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2014-10-13T14:39:52.430Z</Timestamp>
<Ack>Failure</Ack>
<CorrelationID> string </CorrelationID>
<Errors>
<ShortMessage>Invalid shipment tracking number or carrier</ShortMessage>
<LongMessage>You have entered an incorrect shipment tracking number/carrier.</LongMessage>
<ErrorCode>2191111</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Tracking numbers invalid</ShortMessage>
<LongMessage>The following Tracking Numbers are invalid : TRACKING_NUMBER_VALUE.</LongMessage>
<ErrorCode>21916897</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorParameters ParamID="0">
<Value>TRACKING_NUMBER_VALUE</Value>
</ErrorParameters>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Internal error to the application.</ShortMessage>
<LongMessage>Internal error to the application.</LongMessage>
<ErrorCode>10007</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>An error occurred.</ShortMessage>
<LongMessage>An error number "{0}" occurred while processing your request.</LongMessage>
<ErrorCode>36</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>893</Version>
<Build>E893_CORE_APIXO_17070435_R1</Build>
</CompleteSaleResponse>
Why I am not getting the success in response?
The tracking Number is like: 1Z7X887R0368851221 and carrier is 'UPS'
Please help.
Thanks
Per eBay's own dev site:
Error 10007 ("Internal error to the application") indicates an error on the eBay server side, not an error in your application.
So you'd probably need to contact eBay about the specific issue, but my assumption is that while eBay will accept in any information into the Carrier and Tracking number fields, the format of the tracking number field must match some other critieria set by the carrier for inserting into another API upstream.
Have you tested the tracking number in UPS's own tracking mechanism? It returns a valid package tracking response?
Also, per the eBay dev site, if you are using UPS Mail Innovations rather than UPS, the carrier name to specifiy is UPS-MI.

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
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.