Route and Time API Model
The route object exists in listings, shipments, and rate requests models. It contains information for the time and place of important events like pickup and delivery.
Distance Fields
Field | Type | Description | Sample Values |
---|---|---|---|
kilometers | Decimal | The number of kilometers traveled for the listing route. | 1123.45 |
label | String | The localized string description of the distance traveled for the listing route. | "698 miles" |
shortLabel | String | The localized string for the route distance as shown on a mobile or touch device. | "698 mi." |
Item Fields
The array order is preserved.
- The origin address is the first item in the route array.
- The destination address is the last item in the route array.
Field | Type | Description | Sample Values |
---|---|---|---|
address | Container | Required wrapper for the address fields. | |
streetAddress | String | The physical street address where the shipment will be picked up or delivered. | "200 Henry Road" |
alternateStreetAddress | String | Additional detail on address, often the building, unit or suite number. | "Apt 128C" |
majorMunicipality | String | The main city or town where the shipment will be picked up or delivered. Required with stateProvince when postalCode or latitude and longitude are not provided. | "Baton Rouge" |
postalCode | String | The postal code where the shipment will be picked up or delivered. International postal codes are supported. Required if majorMunicipality and stateProvince or latitude and longitude are not provided. | "70744" |
stateProvince | String | The abbreviated state or province where the shipment is picked up or delivered. Required with majorMunicipality when postalCode or latitude and longitude are not provided. | "LA" |
stateProvinceLabel | String | The localized name of the state or province. | "Louisiana" |
country | String | The required alpha-2 country code where the shipment will be picked up or delivered. | "US" |
countryLabel | String | The localized name of the country or nation. | "United States", "États-Unis" |
latitude | Decimal | The geographical latitude of the shipment location in decimal degrees. Required with longitude when postalCode or majorMunicipality and stateProvince are not provided. | 34.096629 |
longitude | Decimal | The geographical longitude of the shipment location in decimal degrees. Required with latitude when postalCode or majorMunicipality and stateProvince are not provided. | -118.412426 |
label | String | The localized name of the location. The city and abbreviated state/province for the latitude and longitude. | "Miami, FL" |
shortLabel | String | The localized string for the location name as shown on a mobile or touch device. When a location is geocoded, the city or major municipality and state or province abbreviation is returned. This field is intended for mobile application and mobile responsive consumers. | "Miami, FL" |
type | String | The kind of pick up or delivery address. See Address Types. | "Residence" or "Domicile" (localized label) |
timeZone | String | Time zone for the shipment.
| "America/Chicago", "America/Los_Angeles" |
timeFrame | Container | Required wrapper for the arrival or delivery fields. | |
label | String | The localized description of the pick up or delivery date or date range. | "Before 8/5/2012", "On 7/17/2014" "Avant le 25/01/2013" "Entre le 04/02/2013 - 14/02/2013 |
shortLabel | String | The localized description of the pick up or delivery date or date range as shown on a mobile or touch device. | "Before 8/5", "7/17" | "Avant le 25/01" | "04/02 - 14/02" |
earliestArrival | String | The earliest date the pick up or delivery date can occur. Use "YYYY/MM/DD" for the input format. Also valid: YYYY-MM-DD or MM/DD/YYYY | "2014/10/10" as input and can return more specifically as "2014-10-10T00:00:00" |
latestArrival | String | The latest date the pick up or delivery date can occur. Use "YYYY/MM/DD" for the input format. Also valid: YYYY-MM-DD or MM/DD/YYYY | "2014/10/20" as input and can return more specifically as "2014-10-20T00:00:00 |
timeFrameType | String | The time frame type value to specify. Valid Options: "after", "before", "between", and "on" where you must specify the date range for "between". When using "on" the earliest and latest arrival dates must match exactly. If this field returns, it is a container wrapper for the data trio, the value, label, and shortLabel. Example GET /v2/listings/
| "on", "between", "after", "flexible" |
Sample Request
Depending on the resource accessed, the "route" wrapper may not be used. Terminal information only available when provided.
{
"route": {
"items": [
{
"address": {
"streetAddress": "100 Avenue A",
"alternateStreetAddress": "Bldg 2, Suite 100",
"majorMunicipality": "Tampa",
"postalCode": "33623",
"stateProvince": "FL",
"country": "US",
"latitude": 28.056858,
"longitude": -82.605871,
"type": "Residence",
"timeZone": "America/New_York"
},
"timeFrame": {
"earliestArrival": "2014-11-01T00:00:00Z",
"latestArrival": "2014-11-01T00:00:00Z",
"timeFrameType": "on"
},
"terminal": {
"phoneNumber": "9876543210",
"city": "Tampa",
"state": "FL",
"postalCode": "33623"
}
},
{
"address": {
"postalCode": "78741",
"country": "US",
"type": "Residence"
},
"timeFrame": {
"earliestArrival": "2014-11-11T00:00:00Z",
"latestArrival": "2014-11-21T00:00:00Z",
"timeFrameType": "between"
},
"terminal": {
"phoneNumber": "1234567890",
"city": "Austin",
"state": "TX",
"postalCode": "78704"
}
}
]
}
}
Additional detail on time frame model
While "earliestArrival", "latestArrival" and "between" are the typical parameters for the time frame model, uShip can support other configurations. Please see the table below for more information on Before, On, and Relative time frames.
Field | Type | Description |
date1 |
String |
Required. The “date1” is an origin or from value that must always be less than the “date2” value. |
date2 |
String |
Required. if supplied as a destination or range value. If specified with the timeFrametype "On", the dates must match exactly. |
delay |
Integer |
Required.when passing in the "timeFrameType" as Relative. The number of days before or after booking/pickup. |
timeFrameType |
String |
Required. The supported values are:
|