亚马逊MWS API:如何保存产品的搜索字词?

时间:2017-07-24 18:59:14

标签: xml amazon-web-services amazon-mws

我在使用亚马逊MWS API上传产品时尝试添加搜索字词,但我在响应中一直收到错误。
这就是我发送的内容

<?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>XXXXXXXXXXX</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>false</PurgeAndReplace>
<Message>
    <MessageID>1</MessageID>
    <OperationType>Update</OperationType>
    <Product>
        <SKU>test-sku-Pink-8-b 5</SKU>
        <StandardProductID>
            <Type>UPC</Type>
            <Value>699178226987</Value>
        </StandardProductID>
        <DescriptionData>
            <Title>
                <![CDATA[test name-Pink-8]]>
            </Title>
            <Brand>Layla K</Brand>
            <Description>
                <![CDATA[This masquerade ball dress comes with a matching shawl and detachable straps at no additional cost! Has hand beaded jewels on sweetheart bodice, skirt &amp; corset / lace up back.]]>
            </Description>
            <MSRP currency="USD">229.99</MSRP>
            <ItemType>Special Occasion Dresses</ItemType>
            <SearchTerms>Dress</SearchTerms><!--trying to add this search term-->
        </DescriptionData>
        <ProductData>
            <Clothing>
                <VariationData>
                    <Size>8</Size>
                    <Color>Pink</Color>
                    <VariationTheme>SizeColor</VariationTheme>
                </VariationData>
                <ClassificationData>
                    <ClothingType>Dress</ClothingType>
                    <Department>womens</Department>
                </ClassificationData>
            </Clothing>
        </ProductData>
    </Product>
</Message>

我得到的错误是

<Result>
            <MessageID>1</MessageID>
            <ResultCode>Error</ResultCode>
            <ResultMessageCode>5000</ResultMessageCode>
            <ResultDescription>XML Parsing Error at Line 24, Column 15: cvc-complex-type.2.4.a: Invalid content was found starting with element 'SearchTerms'. One of '{OtherItemAttributes, TargetAudience, SubjectContent, IsGiftWrapAvailable, IsGiftMessageAvailable, PromotionKeywords, IsDiscontinuedByManufacturer, DeliveryScheduleGroupID, DeliveryChannel, ExternalProductInformation, MaxAggregateShipQuantity, RecommendedBrowseNode, MerchantShippingGroupName, FEDAS_ID, TSDAgeWarning, TSDWarning, TSDLanguage, OptionalPaymentTypeExclusion, DistributionDesignation}' is expected.</ResultDescription>
            <AdditionalInfo>
                <SKU>test-sku-Pink-8-b 5</SKU>
            </AdditionalInfo>
        </Result>

有谁知道我为什么会收到此错误? 我使用亚马逊MWS Scratchpad提交我的Feed。

enter image description here

1 个答案:

答案 0 :(得分:0)

我想出来了。 我不得不切换ItemType和SearchTerms的顺序

<SearchTerms>Dress</SearchTerms>
<ItemType>Special Occasion Dresses</ItemType>