<?xml version="1.0" encoding="UTF-8" ?>
<!--

  RateResponse.dtd

  Copyright (C) 2011, Shipwire Inc.  All rights reserved.

  Last modified: 2011-07-07

-->

<!ELEMENT RateResponse (Status, Error?, Order+, ProcessingTime?)>

<!--
  Status of the request - either "OK" or "Error"
-->
<!ELEMENT Status (#PCDATA)>

<!--
  Text explanation of any problem encountered while processing the rate request
-->
<!ELEMENT Error (#PCDATA)>

<!--
  Order rating information and quotes
-->
<!ELEMENT Order (Quotes)>
<!ATTLIST Order
  sequence CDATA #REQUIRED
>
<!ELEMENT Quotes (Quote*)>

<!--
  Each quote contains:
    Method (attribute): The shipping method (service level) being quoted (either GD, 1D, 2D, FT, E-INTL, INTL, PL-INTL, PM-INTL)

    Warehouse: Location of the warehouse found to be optimal for this shipping method (e.g. Chicago)
    Service: The preferred/optimal carrier service for this method (e.g. UPS Ground)
    CarrierCode: The Shipwire code used to indicate this service (passed to the FulfillmentServices API in the <Carrier> element).
    Cost: The shipping cost associated with this method
    Subtotals: Contains costs which make up the shipping costs
    Subtotal: Current types are "freight", "packaging", and "insurance"

    DeliveryEstimate: If available, the minimum and/or maximum delivery standards for this service
-->
<!ELEMENT Quote (Warehouse, Service, CarrierCode, Cost, Subtotals?, DeliveryEstimate?)>
<!ATTLIST Quote
	method CDATA #REQUIRED
>
<!ELEMENT Warehouse (#PCDATA)>
<!ELEMENT Service (#PCDATA)>
<!ELEMENT CarrierCode (#PCDATA)>
<!ELEMENT Cost (#PCDATA)>
<!ATTLIST Cost
	currency CDATA #REQUIRED
    converted (YES|NO) "NO"
    originalCurrency CDATA #IMPLIED
    originalCost CDATA #IMPLIED
>
<!ELEMENT Subtotals (Subtotal*)>
<!ELEMENT Subtotal (Cost)>
<!ATTLIST Subtotal
    type CDATA #REQUIRED
>
<!ELEMENT DeliveryEstimate (Minimum?, Maximum?)>
<!ELEMENT Minimum (#PCDATA)>
<!ATTLIST Minimum
	units CDATA #REQUIRED
>
<!ELEMENT Maximum (#PCDATA)>
<!ATTLIST Maximum
	units CDATA #REQUIRED
>

<!--
  Time it took to process the rate request (ms)
-->
<!ELEMENT ProcessingTime (#PCDATA)>
<!ATTLIST ProcessingTime
    units CDATA #REQUIRED
>

