2

我正在使用来自 Amazon 的 Feed Api 的 SubmitFeed _POST_FBA_INBOUND_CARTON_CONTENTS_。我提交了这个 XML 文档。对于每个纸箱只有一个 SKU 的简单情况,我已成功使用此调用。这批货物我希望每箱有三个 SKU。Sellercentral 中的订单显示了所有正确的尺寸和重量数据,但它是三个纸箱,而不是一个,即使我只提交了一个纸箱 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>

XSD 文件在这里 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>
4

1 回答 1

4

事实证明我的问题出在其他地方,因此您可以放心地假设我在此处发布的 XML 是有效的。

于 2019-06-08T23:46:38.877 回答