Amazon MWS Error 25 - Do You See An Error With My XML?

606 views Asked by At

I'm trying to automate the shipping confirmation of our Amazon orders, but the submit feed says, "We are unable to process the XML feed because one or more items are invalid. Please re-submit the feed.".

I've checked it against the documentation found here: https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/XML_Documentation_Intl.pdf

Can you please take a look?

<?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>

1

There are 1 answers

0
Hazzit On BEST ANSWER

Your XML does not validate against the XSDs. OrderFulfillment.xsd contains the following passage:

<xsd:choice>
     <xsd:element ref="AmazonOrderID"/>
     <xsd:element ref="MerchantOrderID"/>
</xsd:choice>

meaning, you can only submit either an AmazonOrderID or your MerchantOrderID. The latter is only allowed if you made your own MerchantOrderID known to Amazon in a previous step. Since your system seems to know both, there is no reason not to use the AmazonOrderID.

The following XML feed validates and thus should work:

<?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>