如何提供unit_count_type和unit_count Amazon产品数据提要?

时间:2019-06-24 06:10:39

标签: amazon-mws amazonsellercentral

我在_POST_PRODUCT_DATA_ feed中提供了度量单位和单位计数的值。

XmlElement unitOfMeasure = xmlDocument.CreateElement("unitOfMeasure");
unitOfMeasure.InnerText = "Count";
Product.AppendChild(unitOfMeasure);

 XmlElement UnitCount = xmlDocument.CreateElement("UnitCount");
 UnitCount.InnerText = "1";
 Product.AppendChild(UnitCount);

我的xml提要看起来像这样

    <?xml version="1.0" encoding="iso-8859-1"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
  <Header>
    <DocumentVersion>1.01</DocumentVersion>
    <MerchantIdentifier>xxxxxxx</MerchantIdentifier>
  </Header>
  <MessageType>Product</MessageType>
  <PurgeAndReplace>false</PurgeAndReplace>
  <Message>
    <MessageID>1</MessageID>
    <OperationType>Update</OperationType>
    <Product>
      <SKU>book1568388578</SKU>
      <StandardProductID>
        <Type>ASIN</Type>
        <Value>1568388578</Value>
      </StandardProductID>
      <ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
      <unitOfMeasure>count</unitOfMeasure>
      <UnitCount>1</UnitCount>
      <DescriptionData>
        <Title>Relapse Prevention Long-term Workbook</Title>
        <Brand> </Brand>
        <Description> </Description>
        <BulletPoint> </BulletPoint>
        <BulletPoint> </BulletPoint>
        <MSRP currency="USD">70.74</MSRP>
        <Manufacturer>Hazelden Foundation,U.S.</Manufacturer>
        <ItemType>books</ItemType>
      </DescriptionData>
      <ProductData>
        <Health>
          <ProductType>
            <HealthMisc>
              <Ingredients>Example Ingredients</Ingredients>
              <Directions>Example Directions</Directions>
            </HealthMisc>
          </ProductType>
        </Health>
      </ProductData>
    </Product>
  </Message>

</AmazonEnvelope>

我在Feed结果中遇到以下错误。

  

第19行第22列的XML解析错误:cvc-complex-type.2.4.a:发现从元素'unitOfMeasure'开始的无效内容。 “ {LaunchDate,DiscontinueDate,ReleaseDate,ExternalProductUrl,Condition,Rebate,ItemPackageQuantity,NumberOfItems,LiquidVolume,DescriptionData,DiscoveryData,ProductData,ShippedByFreight,EnhancedImageURL,Amazon-Vendor-Only,Amazon-Only,RegisteredParameter,NationalStockNumber,UnspscCode,UVPPrice”之一”。

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。您需要在HealthMisc中提供此单位计数供稿 正确的xml ..

    <?xml version="1.0" encoding="iso-8859-1"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
  <Header>
    <DocumentVersion>1.01</DocumentVersion>
    <MerchantIdentifier>xxxxxxxxxx</MerchantIdentifier>
  </Header>
  <MessageType>Product</MessageType>
  <PurgeAndReplace>false</PurgeAndReplace>
  <Message>
    <MessageID>1</MessageID>
    <OperationType>Update</OperationType>
    <Product>
      <SKU>book1568388578</SKU>
      <StandardProductID>
        <Type>ASIN</Type>
        <Value>1568388578</Value>
      </StandardProductID>
      <ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
      <DescriptionData>
        <Title>Relapse Prevention Long-term Workbook</Title>
        <Brand> </Brand>
        <Description> </Description>
        <BulletPoint> </BulletPoint>
        <BulletPoint> </BulletPoint>
        <MSRP currency="USD">70.74</MSRP>
        <Manufacturer>Hazelden Foundation,U.S.</Manufacturer>
        <ItemType>books</ItemType>
      </DescriptionData>
      <ProductData>
        <Health>
          <ProductType>
            <HealthMisc>
              <UnitCount unitOfMeasure="Count">1</UnitCount>
              <Ingredients>Example Ingredients</Ingredients>
              <Directions>Example Directions</Directions>
            </HealthMisc>
          </ProductType>
        </Health>
      </ProductData>
    </Product>
  </Message>
</AmazonEnvelope>