【问题标题】:Unable to add item on eBay API due to Item Specific Type missing由于缺少项目特定类型,无法在 eBay API 上添加项目
【发布时间】:2021-01-08 10:26:40
【问题描述】:

调用 eBay AddItemRequest API 时出现以下错误

缺少项目特定类型。将 Type 添加到此列表中,输入一个有效值,然后重试。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>

我们正在尝试通过 eBay API 使用上述 XML 添加项目,但无法这样做。我们在 XML 格式中做错了什么?此外,我们在遇到错误时添加了特定数据。

【问题讨论】:

    标签: ebay-api ebay-sdk ebay-lms


    【解决方案1】:

    添加ItemSpecifics 时,您需要检查是否有任何ItemSpecific 条目对您的CategoryID 是必需的。这可以通过GetCategorySpecifics API 进行检查。

    在您的情况下,类别 ID 是 176971,在 XML 有效负载中,现有两个 ItemSpecificsBrandMPN。正如您从 eBay 上的 GetCategorySpecifics API 获得并确认的错误消息所建议的那样,很明显您需要在 ItemSpecifics 中添加名称为 Type 的 ItemSpecific。完成此操作后,您的 ItemSpecifics 应如下所示:

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

    添加Type ItemSpecific 后,您可以使用VerifyAddItemResponse API 验证调用。

    一般来说,要确定给定CategoryId 需要哪些ItemSpecifics,您可以参考以下文档(Listing with Required Item Specifics。但是,非常简单地说,要确定需要哪些项目详细信息,请致电GetCategorySpecifics检索您列出的类别的项目具体建议。在响应中,为每个建议查找以下字段:

    • 类别需要此项目的特定名称:Recommendations.NameRecommendation.ValidationRules.MinValues
    • 您只能使用 eBay 定义的以下值之一(在响应中返回):Recommendations.NameRecommendation.ValidationRules.SelectionMode=SelectionOnly

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-30
      • 1970-01-01
      • 2015-01-15
      • 2019-10-22
      • 1970-01-01
      • 1970-01-01
      • 2014-03-17
      • 2019-09-27
      相关资源
      最近更新 更多