Skip to content

Instantly share code, notes, and snippets.

@evanr76 evanr76/RateRequest.dtd
Last active Oct 8, 2015

Embed
What would you like to do?
Shipwire: Shipping Rate Request DTD
<?xml version="1.0" encoding="UTF-8" ?>
<!--
RateRequest.dtd
Copyright (C) 2014, Shipwire Inc. All rights reserved.
Last modified: 2014-03-17
-->
<!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?, WarehouseContinents?, WarehouseCountry?, AddressInfo*, Item+)>
<!ATTLIST Order
id CDATA #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)>
<!--
Continents to which to restrict warehouse selection
-->
<!ELEMENT WarehouseContinents (Continent+)>
<!--
Valid continents are:
NORTH_AMERICA
SOUTH_AMERICA
EUROPE
ASIA
AFRICA
AUSTRALIA
ANTARCTICA
-->
<!ELEMENT Continent (#PCDATA)>
<!--
Warehouse country routing restriction
Please use ISO-3166-2 codes e.g.
US: United States
CA: Canada
GB: United Kingdom
-->
<!ELEMENT WarehouseCountry (#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)>
@maxrice

This comment has been minimized.

Copy link

commented Dec 26, 2012

Address Line 1 appears to not be required for calculating rates when actually sending XML, though this DTD specifies that it is. Maybe it's out of date?

@evanr76

This comment has been minimized.

Copy link
Owner Author

commented Jun 25, 2013

The API implementation is currently more lenient than the DTD and will accept rate requests without any address lines. However, this comes at the cost of rating accuracy and number of services considered. Many services cannot accurately rate orders without address lines, and without address lines we cannot reliably distinguish special circumstances that may affect service availability or price. For these reasons we made the DTD stricter about Address1.

@gb0101010101

This comment has been minimized.

Copy link

commented Apr 22, 2014

There are a couple of elements that differ between RateRequest and OrderList DTDs. Would be nice if they were the same.

Zip or PostalCode?

RateRequest

No mention of Postal Code.

OrderList

Source or Referer?

RateRequest

OrderList

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.