我正在尝试自动执行亚马逊订单的送货确认,但提交Feed表示,"我们无法处理XML Feed,因为一个或多个项目无效。请重新提交Feed。"。
我已根据此处的文档检查了它:https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/XML_Documentation_Intl.pdf
你能看一下吗?
<?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>MY-MERCHANT-ID</MerchantIdentifier>
</Header>
<MessageType>OrderFulfillment</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderFulfillment>
<AmazonOrderID>116-8390288-9796217</AmazonOrderID>
<MerchantOrderID>877399</MerchantOrderID>
<FulfillmentDate>2016-12-28T22:55:27-08:00</FulfillmentDate>
<FulfillmentData>
<CarrierName>USPS</CarrierName>
<ShippingMethod>Standard</ShippingMethod>
<ShipperTrackingNumber>9400110200830414375387</ShipperTrackingNumber>
</FulfillmentData>
<Item>
<AmazonOrderItemCode>40322771766298</AmazonOrderItemCode>
<Quantity>1</Quantity>
</Item>
</OrderFulfillment>
</Message>
</AmazonEnvelope>
&#13;
答案 0 :(得分:1)
您的XML不会针对XSD进行验证。 OrderFulfillment.xsd
包含以下段落:
<xsd:choice>
<xsd:element ref="AmazonOrderID"/>
<xsd:element ref="MerchantOrderID"/>
</xsd:choice>
意思是,您只能提交 AmazonOrderID
或您的MerchantOrderID
。只有在您之前的步骤中为亚马逊知道自己的MerchantOrderID
时,才允许使用后者。由于您的系统似乎都知道两者,因此没有理由不使用AmazonOrderID
。
以下XML Feed验证,因此应该有效:
<?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>MY-MERCHANT-ID</MerchantIdentifier>
</Header>
<MessageType>OrderFulfillment</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderFulfillment>
<AmazonOrderID>116-8390288-9796217</AmazonOrderID>
<FulfillmentDate>2016-12-28T22:55:27-08:00</FulfillmentDate>
<FulfillmentData>
<CarrierName>USPS</CarrierName>
<ShippingMethod>Standard</ShippingMethod>
<ShipperTrackingNumber>9400110200830414375387</ShipperTrackingNumber>
</FulfillmentData>
<Item>
<AmazonOrderItemCode>40322771766298</AmazonOrderItemCode>
<Quantity>1</Quantity>
</Item>
</OrderFulfillment>
</Message>
</AmazonEnvelope>