Search code examples
amazon-mwsamazon-fba

How do I form an Amazon FBA CartonContentsRequest XML with more than one SKU per carton


I am using the SubmitFeed _POST_FBA_INBOUND_CARTON_CONTENTS_ from Amazon's Feeds Api. I submit this XML doc. I have used this call successfully for simple cases where there is just one SKU per carton. This shipment I want to have three SKUs per carton. The order in sellercentral shows all the correct dimension and weight data but has it as three cartons, not one, even though I submitted only one carton id.

<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
   <Header>
      <DocumentVersion>1.01</DocumentVersion>
      <MerchantIdentifier>**************</MerchantIdentifier>
   </Header>
   <MessageType>CartonContentsRequest</MessageType>
   <Message>
      <MessageID>1</MessageID>
      <CartonContentsRequest>
         <ShipmentId>FBA******S2F</ShipmentId>
         <NumCartons>1</NumCartons>
         <Carton>
            <CartonId>55172</CartonId>
            <Item>
               <SKU>SKU-ABC</SKU>
               <QuantityShipped>48</QuantityShipped>
               <QuantityInCase>24</QuantityInCase>
            </Item>
            <Item>
               <SKU>SKU-DEF</SKU>
               <QuantityShipped>48</QuantityShipped>
               <QuantityInCase>24</QuantityInCase>
            </Item>
            <Item>
               <SKU>SKU-XYZ</SKU>
               <QuantityShipped>72</QuantityShipped>
               <QuantityInCase>24</QuantityInCase>
            </Item>
         </Carton>
      </CartonContentsRequest>
   </Message>
</AmazonEnvelope>

The XSD file is here https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_4_1/CartonContentsRequest.xsd

<?xml version="1.0"?>
<!-- Revision="$Revision: #3 $" -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <!--
  $Date: 2006/11/21 $

  AMAZON.COM CONFIDENTIAL.  This document and the information contained in it are
  confidential and proprietary information of Amazon.com and may not be reproduced, 
  distributed or used, in whole or in part, for any purpose other than as necessary 
  to list products for sale on the www.amazon.com web site pursuant to an agreement 
  with Amazon.com.
    -->
    <xsd:include schemaLocation="amzn-base.xsd"/>
    <xsd:element name="CartonContentsRequest">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="ShipmentId">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:pattern value="FBA[A-Z0-9]+" />
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:element>
                <xsd:element name="NumCartons" type="xsd:positiveInteger" />
                <xsd:element name="Carton" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="CartonId">
                                <xsd:simpleType>
                                    <xsd:restriction base="xsd:string">
                                        <xsd:pattern value="[a-zA-Z0-9]+" />
                                    </xsd:restriction>
                                </xsd:simpleType>
                            </xsd:element>
                            <xsd:element name="Item" maxOccurs="200">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:element ref="SKU"/>
                                        <xsd:element name="QuantityShipped" type="xsd:positiveInteger" />
                                        <xsd:element name="QuantityInCase" type="xsd:positiveInteger" default="1"/>
                                        <xsd:element name="ExpirationDate" type="xsd:date" minOccurs="0" />
                                    </xsd:sequence>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

Solution

  • It turns out my problem was elsewhere so you can safely assume the XML I posted here is valid.