Search code examples
amazon-web-servicesamazon-mwsmws

Amazon MWS Marking multiple orders as shipped using one feed


I have prepared feed for submitting orders which are shipped.

It is working perfectly with one order, but somehow it doesn't work for multiple orders and states following error.

       <Result>
            <MessageID>9223372036854775807</MessageID>
            <ResultCode>Error</ResultCode>
            <ResultMessageCode>50001</ResultMessageCode>
            <ResultDescription>The XML you submitted is ill-formed at the Amazon Envelope XML level at (or near) line 24, column 23.</ResultDescription>
        </Result>

and my feed is below.

<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xsi:noNamespaceSchemaLocation="amzn-envelope.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
    <DocumentVersion>1.01</DocumentVersion>
    <MerchantIdentifier>xxxxxxxxxxxx</MerchantIdentifier>
  </Header>
  <MessageType>OrderFulfillment</MessageType>
  <Message>
    <MessageID>1</MessageID>
    <OperationType>Update</OperationType>
    <OrderFulfillment>
      <AmazonOrderID>123-4567-78965</AmazonOrderID>
      <FulfillmentDate>2018-05-21T06:58:20Z</FulfillmentDate>
      <FulfillmentData>
        <CarrierName>xxxxx</CarrierName>
        <ShippingMethod>xxxx</ShippingMethod>
        <ShipperTrackingNumber>xxxxxx</ShipperTrackingNumber>
      </FulfillmentData>
      <Item>
        <AmazonOrderItemCode>1233</AmazonOrderItemCode>
        <Quantity>1</Quantity>
      </Item>
    </OrderFulfillment>
    <OrderFulfillment>
      <AmazonOrderID>123-4567-78966</AmazonOrderID>
      <FulfillmentDate>2018-05-22T06:58:18Z</FulfillmentDate>
      <FulfillmentData>
        <CarrierName>xxxx</CarrierName>
        <ShippingMethod>xxxx</ShippingMethod>
        <ShipperTrackingNumber>xxxxxx</ShipperTrackingNumber>
      </FulfillmentData>
      <Item>
        <AmazonOrderItemCode>xxxxxxxxx</AmazonOrderItemCode>
        <Quantity>1</Quantity>
      </Item>
    </OrderFulfillment>
  </Message>
</AmazonEnvelope>

Let me know if i missing something. Thanks


Solution

  • Thanks, @ScottG for remembering me this. There was a small change in XML feed, just break it into a number of messages as per orders means one message per order feed.

    So the solution is

    <?xml version="1.0" encoding="UTF-8"?>
    <AmazonEnvelope xsi:noNamespaceSchemaLocation="amzn-envelope.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Header>
            <DocumentVersion>1.01</DocumentVersion>
            <MerchantIdentifier>xxxxxxxxxxxx</MerchantIdentifier>
        </Header>
        <MessageType>OrderFulfillment</MessageType>
        <Message>
            <MessageID>1</MessageID>
            <OperationType>Update</OperationType>
            <OrderFulfillment>
                <AmazonOrderID>123-4567-78965</AmazonOrderID>
                <FulfillmentDate>2018-05-21T06:58:20Z</FulfillmentDate>
                <FulfillmentData>
                    <CarrierName>xxxxx</CarrierName>
                    <ShippingMethod>xxxx</ShippingMethod>
                    <ShipperTrackingNumber>xxxxxx</ShipperTrackingNumber>
                </FulfillmentData>
                <Item>
                    <AmazonOrderItemCode>1233</AmazonOrderItemCode>
                    <Quantity>1</Quantity>
                </Item>
            </OrderFulfillment>
        </Message>
        <Message>
            <MessageID>2</MessageID>
            <OperationType>Update</OperationType>
            <OrderFulfillment>
                <AmazonOrderID>123-4567-78966</AmazonOrderID>
                <FulfillmentDate>2018-05-22T06:58:18Z</FulfillmentDate>
                <FulfillmentData>
                    <CarrierName>xxxx</CarrierName>
                    <ShippingMethod>xxxx</ShippingMethod>
                    <ShipperTrackingNumber>xxxxxx</ShipperTrackingNumber>
                </FulfillmentData>
                <Item>
                    <AmazonOrderItemCode>xxxxxxxxx</AmazonOrderItemCode>
                    <Quantity>1</Quantity>
                </Item>
            </OrderFulfillment>
        </Message>
    </AmazonEnvelope>