I am listing an item to ebay where my listing condition is
All listings should be:
1. Private (so the item sold is not displayed on my feedback)
2. Buy It Now only
3. All listing duration is ‘Good till cancelled’
4. Postage is ‘Other 24 hour’ dispatch in 1 working day
5. Express postage available at £7.99 extra
I am getting these error
i. Input data for tag is invalid or missing. Please check API documentation. [Value] => Item.PrimaryCategory.CategoryID and
ii. The duration “GTC” days(s) is not available for this listing type, or invalid for category “309”.
If anyone has idea, please help. Here is my code.
$requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>';
$requestXmlBody .= '<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">';
$requestXmlBody .= "<RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>";
$requestXmlBody .= '<ErrorLanguage>en_US</ErrorLanguage>';
$requestXmlBody .= '<WarningLevel>High</WarningLevel>';
$requestXmlBody .= '<Item>';
$requestXmlBody .= "<Title><![CDATA[$Title]]></Title>";
$requestXmlBody .= '<Description><![CDATA[Seller assumes all responsibility for this listing.]]></Description>';
$requestXmlBody .= '<PrimaryCategory><CategoryID>$primaryCategory</CategoryID></PrimaryCategory>';
$requestXmlBody .= "<StartPrice currencyID='GBP'>$FinalPrice</StartPrice>";
//$requestXmlBody .= '<BuyItNowPrice currencyID="GBP">$FinalPrice</BuyItNowPrice>';
$requestXmlBody .= '<ConditionID>1000</ConditionID>';
$requestXmlBody .= '<CategoryMappingAllowed>true</CategoryMappingAllowed>';
$requestXmlBody .= '<Country>GB</Country>';
$requestXmlBody .= '<Currency>GBP</Currency>';
$requestXmlBody .= '<ListingDuration>GTC</ListingDuration>';
$requestXmlBody .= '<ListingType>FixedPriceItem</ListingType>';
$requestXmlBody .= '<PaymentMethods>PayPal</PaymentMethods>';
$requestXmlBody .= '<PayPalEmailAddress>[email protected]</PayPalEmailAddress>';
$requestXmlBody .= "<PictureDetails><PictureURL>" . $addPicture . "</PictureURL></PictureDetails>";
//$requestXmlBody .= "<PostalCode>95125</PostalCode>";
$requestXmlBody .= "<Quantity>10</Quantity>";
$requestXmlBody .= "<ReturnPolicy>";
$requestXmlBody .= "<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>";
//$requestXmlBody .= "<RefundOption>MoneyBack</RefundOption>";
$requestXmlBody .= "<ReturnsWithinOption>Days_30</ReturnsWithinOption>";
$requestXmlBody .= "<Description>If you are not satisfied, return the item for refund.</Description>";
$requestXmlBody .= "<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>";
$requestXmlBody .= "</ReturnPolicy>";
$requestXmlBody .= "<ShippingDetails>";
$requestXmlBody .= "<ShippingType>Flat</ShippingType>";
$requestXmlBody .= "<ShippingServiceOptions>";
$requestXmlBody .= "<ShippingServicePriority>1</ShippingServicePriority>";
$requestXmlBody .= "<ShippingService>USPSMedia</ShippingService>";
$requestXmlBody .= "<ShippingServiceCost>2.50</ShippingServiceCost>";
$requestXmlBody .= "</ShippingServiceOptions>";
$requestXmlBody .= "</ShippingDetails>";
$requestXmlBody .= "<Site>UK</Site>";
$requestXmlBody .= "<!-- Change the UUID for each item you list. It needs to be unique. -->";
//$requestXmlBody .= "<UUID>ccefc1e08ac811ddad8b0800200c9a68</UUID>";
$requestXmlBody .= "</Item>";
$requestXmlBody .= "</AddItemRequest>";
2
Answers
if you look into the API docs regarding this call you will find a notices on the listduration field: http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/AddItem.html#Request.Item.ListingDuration
“The valid choice of values depends on the listing format (see Item.ListingType). For a list of valid values, call GetCategoryFeatures with DetailLevel set to ReturnAll and look for ListingDurations information. To set a duration of 1 day, the seller must have a Feedback score of at least 10.”
if i call the API for your CatId 309 ( example for testing can be executed here: https://ebay-sdk.intradesys.com/s/44f683a84163b3523afe57c2e008bc8c it returns:
important for you is this line:
that tells you which Set of Duration is available for this listing type… further down within the API response you will see:
if you now look into the durationSetId=8 you will see that GTC is not allowed for this listing type GTC seems only available for the set with id 31 in this case “StoresFixedPrice”
Just a side note: Use business Policies, they will make you life a lot easier when listing via API it will take care of 4 and 5 on your list.