xmlamazon-mws

Upload Amazon Product Variation


I am trying to upload a product using Amazon MWS. My code is the following:

<Message>
    <MessageID>3933</MessageID>
    <OperationType>PartialUpdate</OperationType>
    <Product>
        <SKU>EL01080-CC</SKU> 
        <StandardProductID>
            <Type>EAN</Type>
            <Value>8435405918599</Value>
        </StandardProductID>          
        <Condition>
            <ConditionType>New</ConditionType>
        </Condition>
        <DescriptionData>
            <Title><![CDATA[Power Hair X5 Maquillaje capilar indetectable para calvicie. Bote de 25g , color castaño claro]]></Title> 
            <Brand><![CDATA[PowerHair]]></Brand> 
            <Description><![CDATA[Gama de colores...]]></Description> 
            <Manufacturer><![CDATA[PowerHair]]></Manufacturer>
            <MfrPartNumber><![CDATA[EL01080-CC]]></MfrPartNumber>
            <RecommendedBrowseNode>2928542031</RecommendedBrowseNode>
        </DescriptionData>
        <ProductData><Home>
                <Parentage>child</Parentage>
                <VariationData>
                    <VariationTheme>Size-Color</VariationTheme>
                </VariationData>
                <Size>Medium</Size>
                <Color>Dark Grey Melange</Color>
            </Home></ProductData>
    </Product>
</Message>

And I am getting the following error:

XML Parsing Error at Line 145520, Column 11: cvc-complex-type.2.4.a: Invalid content was found starting with element &"Size&". One of &"{BatteryDescription, CanShipInOriginalContainer, CountryAsLabeled, CountryOfOrigin, CountryProducedIn, ImportDesignation, FurDescription, IdentityPackageType, IncludedComponents, FabricType, PatternName, SeatHeight, SpecialFeatures, StyleName, Occasion, MatteStyle, DisplayLength, DisplayWidth, DisplayHeight, DisplayDepth, DisplayDiameter, DisplayVolume, DisplayWeight, ItemPackageQuantity, ManufacturerWarrantyDescription, Volume, VolumeCapacity, Material, ThreadCount, NumberOfPieces, SafetyWarning, AwardsWon, BatteryAverageLife, BatteryAverageLifeStandby, BatteryChargeTime, BatteryTypeLithiumIon, BatteryTypeLithiumMetal, LithiumBatteryEnergyContent, LithiumBatteryPackaging, LithiumBatteryVoltage, LithiumBatteryWeight, MfgWarrantyDescriptionLabor, MfgWarrantyDescriptionParts, MfgWarrantyDescriptionType, NumberOfItemsInPackage, NumberOfLithiumIonCells, NumberOfLithiumMetalCells, PowerSourceType, RegionOfOrigin, SellerWarrantyDescription, SizeMap, Warnings, Wattage, Length, Width, Height, Depth, Diameter, Weight, Spread, SunlightExposure, MoistureNeeds, USDAHardinessZone, SunsetClimateZone, NumberOfSets}&" is expected.

I can upload it witout problems if I remove ProducData tag. How can I upload it with this variation? I couldn't find any proper documentation of how to do it. I am having problems with Size and Color tags.


Solution

  • Your XML does not validate. The <Size> and <Color> tags need to be nested within <VariationData>. The following is a copy of your XML with added <AmazonEnvelope>, other header data and with the mentioned tags moved:

    <AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
        <Header>
            <DocumentVersion>1.01</DocumentVersion>
            <MerchantIdentifier>YOURMERCHANTIDENTIFIER</MerchantIdentifier>
        </Header>
        <MessageType>Product</MessageType>
        <PurgeAndReplace>false</PurgeAndReplace>
        <Message>
            <MessageID>3933</MessageID>
            <OperationType>PartialUpdate</OperationType>
            <Product>
                <SKU>EL01080-CC</SKU> 
                <StandardProductID>
                    <Type>EAN</Type>
                    <Value>8435405918599</Value>
                </StandardProductID>          
                <Condition>
                    <ConditionType>New</ConditionType>
                </Condition>
                <DescriptionData>
                    <Title><![CDATA[Power Hair X5 Maquillaje capilar indetectable para calvicie. Bote de 25g , color castaño claro]]></Title> 
                    <Brand><![CDATA[PowerHair]]></Brand> 
                    <Description><![CDATA[Gama de colores...]]></Description> 
                    <Manufacturer><![CDATA[PowerHair]]></Manufacturer>
                    <MfrPartNumber><![CDATA[EL01080-CC]]></MfrPartNumber>
                    <RecommendedBrowseNode>2928542031</RecommendedBrowseNode>
                </DescriptionData>
                <ProductData>
                    <Home>
                        <Parentage>child</Parentage>
                        <VariationData>
                            <VariationTheme>Size-Color</VariationTheme>
                            <Size>Medium</Size>
                            <Color>Dark Grey Melange</Color>
                        </VariationData>
                    </Home>
                </ProductData>
            </Product>
        </Message>
    </AmazonEnvelope>
    

    This modified XML file validates against the XSD schema.