<?xml version="1.0" encoding="UTF-8" ?>
<!--

  SubmitOrderResponse.dtd

  Copyright (C) 2012, Shipwire Inc.  All rights reserved.

  Last modified: 2012-08-01

-->
<!ELEMENT SubmitOrderResponse (Status, ErrorMessage?, TotalOrders?, TotalItems?, TransactionId?, OrderInformation?, ProcessingTime)>

<!--
    Result of the FulfillmentServices request.

        0:  Request processed successfully.
    Error:  There was an error during processing.  Please review the content
            of the ErrorMessage element.
-->
<!ELEMENT Status (#PCDATA)>

<!--
    Free-form string indicating problem(s) with the request that prevented
    the request from being processed.
-->
<!ELEMENT ErrorMessage (#PCDATA)>

<!-- Total number of orders processed -->
<!ELEMENT TotalOrders (#PCDATA)>

<!-- Total number of items (SKUs) processed across all orders -->
<!ELEMENT TotalItems (#PCDATA)>

<!-- The transaction ID or "Shipwire ID" of the whole order batch -->
<!ELEMENT TransactionId (#PCDATA)>

<!-- Processed order(s) information -->
<!ELEMENT OrderInformation (Order*) >
<!ELEMENT Order (Exception?, WarningList?, Holds?, Shipping, Routing?, UnfilledItems?)>

<!--
    Order attributes

    number:  references the Order id attribute from the fulfillment request
        id:  the Transaction ID or "Shipwire ID" of this order
    status:  "accepted" if there were no exceptions and the order is expected
             to submit to the warehouse normally, or "held" if one or more
             holds must first be resolved before the order can ship.
-->
<!ATTLIST Order
    number CDATA #REQUIRED
    id CDATA #REQUIRED
    status (accepted|held) #REQUIRED
>

<!--
    Textual description of any exceptions triggered while processing this
    order.
    
    Exceptions are conditions which cause orders to be held, and must be
    resolved before the order can ship.
    
    Examples of exceptions include:
    - Insufficient stock
    - Invalid ship-to address
    - No items in the order
-->
<!ELEMENT Exception (#PCDATA)>

<!--
    Warnings are less serious conditions which usually do not impede
    shipment, unless you have configured orders to be held because of the
    warning condition.

    Examples of warnings include:
    - Invalid ship-to customer e-mail address
-->
<!ELEMENT WarningList (Warning*)>
<!ELEMENT Warning (#PCDATA)>

<!--
    Holds are a more structured representation of exceptions encountered
    during order processing.  These correspond directly to Order Holds in
    the Shipwire application.
-->
<!ELEMENT Holds (Hold+)>
<!ELEMENT Hold (Type, Description)>
<!ELEMENT Type (#PCDATA)>
<!ELEMENT Description (#PCDATA)>

<!--
    Information about from where the order will ship, and the shipping method
    selected.
-->
<!ELEMENT Shipping (Warehouse, Service, Cost)>

<!--
    The warehouse selected to ship the order.

    Examples:  Chicago
               Los Angeles
               UK

-->
<!ELEMENT Warehouse (#PCDATA)>

<!--
    The carrier and service selected for the order.

    Examples:  USPS Priority Mail + Delivery Confirmation
               UPS Standard
               Royal Mail International Signed For
-->
<!ELEMENT Service (#PCDATA)>

<!-- The estimated shipping cost in USD -->
<!ELEMENT Cost (#PCDATA)>

<!ELEMENT Routing (Origin?, Destination?)>
<!ELEMENT Origin (Latitude, Longitude)>
<!ELEMENT Destination (Latitude, Longitude)>
<!ELEMENT Latitude (#PCDATA)>
<!ELEMENT Longitude (#PCDATA)>
<!--
    For split orders, list the items that will not be filled by the first
    shipping order.
-->
<!ELEMENT UnfilledItems (Item+)>
<!ELEMENT Item (Code, Quantity)>
<!ELEMENT Code (#PCDATA)>
<!ELEMENT Quantity (#PCDATA)>

<!--
  Time it took to process the request (ms)
-->
<!ELEMENT ProcessingTime (#PCDATA)>
<!ATTLIST ProcessingTime
    units CDATA #REQUIRED
    queued (YES|NO) "YES"
    queueId CDATA #IMPLIED
>
