【问题标题】:eBay API addItem request with custom category returns 'Input data is invalid' error具有自定义类别的 eBay API addItem 请求返回“输入数据无效”错误
【发布时间】:2023-03-08 05:36:02
【问题描述】:

通常我可以使用 API 的 addItem 调用添加项目,但是当尝试使用自定义类别时,每次都会失败。任何想法为什么?

例如,addItem相同请求适用于一个类别,但对于自定义类别,相同的请求会失败。自定义类别是从getStore 方法返回的,并且看起来是有效的!这发生在实时和沙盒中。

例子:

  • 工作类别:3507889013(壁纸)-作品
  • 自定义类别:3507905013(超级壁画) - 失败!

失败响应:

输入数据无效。标签的输入数据 无效或丢失。请检查 API 文档。 37、错误Item.PrimaryCategory.CategoryID 请求错误

感谢您的帮助!

已发送 XML:

<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>[my token in here]</eBayAuthToken>
</RequesterCredentials>
<Item>
<Title>* TEST ITEM * Please do not click, or buy this item5</Title>
<Description>[some text]</Description>
<PrimaryCategory>
<CategoryID>3507905013</CategoryID>
</PrimaryCategory>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<PictureDetails>
<PictureURL>[image url]</PictureURL>
</PictureDetails>
<StartPrice>49.99</StartPrice>
<ConditionID>1000</ConditionID>
<Country>GB</Country>
<Currency>GBP</Currency>
<DispatchTimeMax>1</DispatchTimeMax>
<ListingDuration>GTC</ListingDuration>
<ListingType>FixedPriceItem</ListingType>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>[email]</PayPalEmailAddress>
<Location>Lancashire</Location>
<ProductListingDetails>
<UPC>3700166628625</UPC>
<IncludeStockPhotoURL>true</IncludeStockPhotoURL>
<IncludePrefilledItemInformation>true</IncludePrefilledItemInformation>
</ProductListingDetails>
<Quantity>30</Quantity>
<ReturnPolicy>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<ReturnsWithinOption>Days_14</ReturnsWithinOption>
<Description>[some text]</Description>
</ReturnPolicy>
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>UK_RoyalMailFirstClassStandard</ShippingService>
<ShippingServiceCost>0</ShippingServiceCost>
<ShippingServiceAdditionalCost>0</ShippingServiceAdditionalCost>
</ShippingServiceOptions>
<InternationalShippingServiceOption>
<ShippingService>UK_IntlTrackedPostage</ShippingService>
<ShippingServiceAdditionalCost currencyID="GBP">0</ShippingServiceAdditionalCost>
<ShippingServiceCost currencyID="GBP">0</ShippingServiceCost>
<ShippingServicePriority>1</ShippingServicePriority>
<ShipToLocation>IE</ShipToLocation>
</InternationalShippingServiceOption>
</ShippingDetails>
<Site>UK</Site>
</Item>
</AddItemRequest>

【问题讨论】:

    标签: categories ebay-api


    【解决方案1】:

    对于其他为此苦苦挣扎的人,此答案来自 eBay_DTS_Shruti 在易趣上https://go.developer.ebay.com/developers/ebay/forums/ebay-apis-selling/additem-fails-only-my-custom-categories#answer-332698

    并解决了这个问题。

    R


    您的 AddFixedPriceItem 失败的原因是您在错误的标签中指定了 StoreCategoryID。

    PrimaryCategoryID (http://developer.ebay.com/DevZone/XML/docs/Reference/ebay/AddFixedPriceI...) 应包含 eBay CategoryID,并且应在 StoreCategoryID 中指定自定义商店 categoryID

    在请求中应该是这样的:

    <Storefront>
    <StoreCategoryID>2328253017</StoreCategoryID>
    <StoreCategory2ID>0</StoreCategory2ID>
    </Storefront>
    

    请注意,您需要在 AddFixedPriceItem 请求中同时指定实际 eBay 类别和 StoreCategory。

    希望这会有所帮助。

    干杯!!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-20
      • 1970-01-01
      • 1970-01-01
      • 2011-01-04
      • 1970-01-01
      相关资源
      最近更新 更多