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

  RateRequest.dtd

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

  Last modified: 2011-06-05

-->
<!ELEMENT RateRequest ((EmailAddress|Username), Password, Order+)>
<!ATTLIST RateRequest
	rateset (all|shipwire) #IMPLIED
    currency CDATA #IMPLIED
>

<!--
    Shipwire login email address, for legacy authentication [deprecated]

    New integrations should authenticate with API users via <Username>
-->
<!ELEMENT EmailAddress (#PCDATA)>

<!-- API username -->
<!ELEMENT Username (#PCDATA)>

<!--
    Password for the provided API user (<Username>) or Shipwire login (<EmailAddress>)

    Please enclose in a CDATA block if appropriate
-->
<!ELEMENT Password (#PCDATA)>

<!--
  One or more orders to be rated
-->
<!ELEMENT Order (Warehouse?, AddressInfo*, Item+)>
<!ATTLIST Order
    id #IMPLIED
>
<!--
  Warehouse to which Shipwire should route this order

  00: Shipwire should pick the optimal warehouse for me (default, recommended)

  CHI: Chicago
  LAX: Los Angeles
  REN: Reno

  VAN: Vancouver
  TOR: Toronto

  UK: United Kingdom

-->
<!ELEMENT Warehouse (#PCDATA)>

<!ELEMENT AddressInfo (Name?, Company?, Address1, Address2?, Address3?, City, State?, Country, Zip?, Commercial?, PoBox?)>
<!ATTLIST AddressInfo
	type (ship) #REQUIRED
>
<!--
  Optional Container For Name of customer
-->
<!ELEMENT Name (Full)>

<!-- Full name: Individual or company.  Limit to 25 characters or fewer, if possible. -->
<!ELEMENT Full (#PCDATA)>

<!--
  Company name

  Limit to 25 characters or fewer, if possible.
-->
<!ELEMENT Company (#PCDATA)>

<!--
  Address line 1 (required)

  Limit to 25 characters or fewer, if possible.
-->

<!ELEMENT Address1 (#PCDATA)>

<!--
  Address line 2

  Limit to 25 characters or fewer, if possible.
-->
<!ELEMENT Address2 (#PCDATA)>

<!--
  Address line 3

  Limit to 25 characters or fewer, if possible.
-->
<!ELEMENT Address3 (#PCDATA)>

<!-- City: Limit to 25 characters -->
<!ELEMENT City (#PCDATA)>

<!--
  State (or province, region, etc.)

       US or Canada: Use the standardized 2 character code
    Other countries: Please spell the full state/region name
-->
<!ELEMENT State (#PCDATA)>

<!--
  Country of destination

  Please use the standard ISO-3166-2 code

     Example: <Country>US</Country>
     Example: <Country>ES</Country>
     Example: <Country>GB</Country>
-->
<!ELEMENT Country (#PCDATA)>

<!-- ZIP (US) or postal code (other countries) -->
<!ELEMENT Zip (#PCDATA)>

<!-- Commercial address indicator -->
<!ELEMENT Commercial EMPTY>

<!-- Post office box indicator -->
<!ELEMENT PoBox EMPTY>

<!--
  Order line item

  Combinaton of SKU (Code) and quantity to ship

  SKU codes should not repeat within an order; rather, combine
  the quantities into one Item.
-->
<!ELEMENT Item (Code, Quantity)>
<!ATTLIST Item
	num CDATA #REQUIRED
>
<!--
  Product SKU

  Shipwire matches the SKU of each item in the order with a SKU in
  your account.
-->
<!ELEMENT Code (#PCDATA)>
<!-- Quantity -->
<!ELEMENT Quantity (#PCDATA)>

