Last Mile Fleet Solution is currently available only to select customers. Contact sales to learn more.

REST Resource: providers.deliveryVehicles

Stay organized with collections Save and categorize content based on your preferences.

Resource: DeliveryVehicle

The DeliveryVehicle message. A delivery vehicle transports shipments from a depot to a delivery location, and from a pickup location to the depot. In some cases, delivery vehicles also transport shipments directly from the pickup location to the delivery location.

Note: gRPC and REST APIs use different field naming conventions. For example, the DeliveryVehicle.current_route_segment field in the gRPC API and the DeliveryVehicle.currentRouteSegment field in the REST API refer to the same field.

JSON representation
{
  "name": string,
  "lastLocation": {
    object (DeliveryVehicleLocation)
  },
  "navigationStatus": enum (DeliveryVehicleNavigationStatus),
  "currentRouteSegment": string,
  "currentRouteSegmentEndPoint": {
    object (LatLng)
  },
  "remainingDistanceMeters": integer,
  "remainingDuration": string,
  "remainingVehicleJourneySegments": [
    {
      object (VehicleJourneySegment)
    }
  ],
  "attributes": [
    {
      object (DeliveryVehicleAttribute)
    }
  ]
}
Fields
name

string

The unique name of this Delivery Vehicle. The format is providers/{provider}/deliveryVehicles/{vehicle}.

lastLocation

object (DeliveryVehicleLocation)

The last reported location of the Delivery Vehicle.

navigationStatus

enum (DeliveryVehicleNavigationStatus)

The Delivery Vehicle's navigation status.

currentRouteSegment

string (bytes format)

The encoded polyline specifying the route that the navigation recommends taking to the next waypoint. Your driver app updates this when a stop is reached or passed, and when the navigation reroutes. These LatLngs are returned in Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments[0].path (REST) for all active Tasks assigned to the Vehicle.

There are a few cases where this field might not be used to populate Task.journey_sharing_info.remaining_vehicle_journey_segments[0].path (gRPC) or Task.journeySharingInfo.remainingVehicleJourneySegments[0].path (REST):

  • The endpoint of the currentRouteSegment does not match DeliveryVehicle.remaining_vehicle_journey_segments[0].stop (gRPC) or DeliveryVehicle.remainingVehicleJourneySegments[0].stop (REST).

  • The driver app has not updated its location recently, so the last updated value for this field might be stale.

  • The driver app has recently updated its location, but the currentRouteSegment is stale, and points to a previous vehicle stop.

In these cases, Fleet Engine populates this field with a route from the most recently passed VehicleStop to the upcoming VehicleStop to ensure that the consumer of this field has the best available information on the current path of the Delivery Vehicle.

A base64-encoded string.

currentRouteSegmentEndPoint

object (LatLng)

The location where the currentRouteSegment ends. This is not currently populated by the driver app, but you can supply it on deliveryVehicles.patch calls. It is either the LatLng from the upcoming vehicle stop, or the last LatLng of the currentRouteSegment. Fleet Engine will then do its best to interpolate to an actual VehicleStop.

This field is ignored in deliveryVehicles.patch calls if the currentRouteSegment field is empty.

remainingDistanceMeters

integer

The remaining driving distance for the currentRouteSegment. This value is usually updated by the driver app because it is considered to have more accurate information about the current route than Fleet Engine. However, it might be populated by Fleet Engine. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_distance_meters (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDistanceMeters (REST) for all active Tasks assigned to the Delivery Vehicle.

This field is ignored in deliveryVehicles.patch calls if the currentRouteSegment field is empty.

remainingDuration

string (Duration format)

The remaining driving time for the currentRouteSegment. This value is usually updated by the driver app because it is considered to have more accurate information about the current route than Fleet Engine. However, it might be populated by Fleet Engine. For more information, see DeliveryVehicle.current_route_segment. This field is returned in Task.remaining_vehicle_journey_segments[0].driving_duration (gRPC) or Task.remainingVehicleJourneySegments[0].drivingDuration (REST) for all active tasks assigned to the Delivery Vehicle.

This field is ignored in deliveryVehicles.patch calls if the currentRouteSegment field is empty.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

remainingVehicleJourneySegments[]

object (VehicleJourneySegment)

The journey segments assigned to this Delivery Vehicle, starting from the Vehicle's most recently reported location.

attributes[]

object (DeliveryVehicleAttribute)

A list of custom Delivery Vehicle attributes. A Delivery Vehicle can have at most 50 attributes, and each attribute must have a unique key.

DeliveryVehicleNavigationStatus

The vehicle's navigation status.

Enums
UNKNOWN_NAVIGATION_STATUS Unspecified navigation status.
NO_GUIDANCE The Driver app's navigation is in FREE_NAV mode.
ENROUTE_TO_DESTINATION Turn-by-turn navigation is available and the Driver app navigation has entered GUIDED_NAV mode.
OFF_ROUTE The vehicle has gone off the suggested route.
ARRIVED_AT_DESTINATION The vehicle is within approximately 50m of the destination.

DeliveryVehicleAttribute

Describes a vehicle attribute as a key-value pair. The "key:value" string length cannot exceed 256 characters.

JSON representation
{
  "key": string,
  "value": string
}
Fields
key

string

The attribute's key. Keys may not contain the colon character (:).

value

string

The attribute's value.

Methods

create

Creates and returns a new DeliveryVehicle.

get

Returns the specified DeliveryVehicle instance.

list

Gets all DeliveryVehicles that meet the specified filtering criteria.

patch

Writes updated DeliveryVehicle data to Fleet Engine, and assigns Tasks to the DeliveryVehicle.