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

FieldTypeDescriptionSample Values
kilometersDecimalThe number of kilometers traveled for the listing route.1123.45
labelStringThe localized string description of the distance traveled for the listing route."698 miles"
shortLabelStringThe 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.
FieldTypeDescriptionSample Values
addressContainerRequired wrapper for the address fields.
streetAddressStringThe physical street address where the shipment will be picked up or delivered."200 Henry Road"
alternateStreetAddressStringAdditional detail on address, often the building, unit or suite number."Apt 128C"
majorMunicipalityStringThe 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"
postalCodeStringThe 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"
stateProvinceStringThe 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"
stateProvinceLabelStringThe localized name of the state or province."Louisiana"
countryStringThe required alpha-2 country code where the shipment will be picked up or delivered."US"
countryLabelStringThe localized name of the country or nation."United States", "États-Unis"
latitudeDecimalThe geographical latitude of the shipment location in decimal degrees. Required with longitude when postalCode or majorMunicipality and stateProvince are not provided.34.096629
longitudeDecimalThe geographical longitude of the shipment location in decimal degrees. Required with latitude when postalCode or majorMunicipality and stateProvince are not provided.-118.412426
labelStringThe localized name of the location. The city and abbreviated state/province for the latitude and longitude."Miami, FL"
shortLabelStringThe 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"
typeStringThe kind of pick up or delivery address. See Address Types."Residence" or "Domicile" (localized label)
timeZoneString

Time zone for the shipment.

  • When this field is provided or specified in the input JSON body, the API uses the field value as the time zone of the pick up or delivery address. If the value that is provided is not the correct time zone for the pick up or delivery address, the API calculates the correct time zone and that value overrides what is provided.
  • When this field is not specified, the API calculates the time zone of the shipment based on the pick up or delivery address.
"America/Chicago", "America/Los_Angeles"
timeFrameContainerRequired wrapper for the arrival or delivery fields.
labelStringThe 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

shortLabelStringThe 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"
earliestArrivalStringThe 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"
latestArrivalStringThe 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
timeFrameTypeString

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/

  • value: "on",
  • label: "On",
  • shortLabel: "On"
"on", "between", "after", "flexible"

Sample Request

Depending on the resource accessed, the "route" wrapper may not be used. Terminal information only available when provided.

JSON
Copy

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:
  • Before - The pick up or delivery will be made before a specified time frame.
  • between - The pick up or delivery will be made between specified time frames.
  • On - The pick up or delivery will be made on a specified date.
  • Relative - The pick up or delivery will be a specified number of days before or after a specified time frame.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard