# REST Resource: providers.trips

- [Resource: Trip](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#Trip)
  - [JSON representation](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#Trip.SCHEMA_REPRESENTATION)
- [TripStatus](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripStatus)
- [StopLocation](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation)
  - [JSON representation](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation.SCHEMA_REPRESENTATION)
- [TripView](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripView)
- [TripAttribute](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripAttribute)
  - [JSON representation](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripAttribute.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#METHODS_SUMMARY)

## Resource: Trip

Trip metadata.

| JSON representation |
|---|
| ``` { "name": string, "vehicleId": string, "tripStatus": enum (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripStatus`), "tripType": enum (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TripType`), "pickupPoint": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TerminalLocation`) }, "actualPickupPoint": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`) }, "actualPickupArrivalPoint": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`) }, "pickupTime": string, "intermediateDestinations": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TerminalLocation`) } ], "intermediateDestinationsVersion": string, "intermediateDestinationIndex": integer, "actualIntermediateDestinationArrivalPoints": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`) } ], "actualIntermediateDestinations": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`) } ], "dropoffPoint": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TerminalLocation`) }, "actualDropoffPoint": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`) }, "dropoffTime": string, "remainingWaypoints": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TripWaypoint`) } ], "vehicleWaypoints": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TripWaypoint`) } ], "route": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/LatLng`) } ], "currentRouteSegment": string, "currentRouteSegmentVersion": string, "currentRouteSegmentTraffic": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/ConsumableTrafficPolyline`) }, "currentRouteSegmentTrafficVersion": string, "currentRouteSegmentEndPoint": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TripWaypoint`) }, "remainingDistanceMeters": integer, "etaToFirstWaypoint": string, "remainingTimeToFirstWaypoint": string, "remainingWaypointsVersion": string, "remainingWaypointsRouteVersion": string, "numberOfPassengers": integer, "lastLocation": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/VehicleLocation`) }, "lastLocationSnappable": boolean, "view": enum (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripView`), "attributes": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripAttribute`) } ] } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. In the format "providers/{provider}/trips/{trip}" |
| `vehicleId` | `string` ID of the vehicle making this trip. |
| `tripStatus` | ``enum (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripStatus`)`` Current status of the trip. |
| `tripType` | ``enum (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TripType`)`` The type of the trip. |
| `pickupPoint` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TerminalLocation`)`` Location where customer indicates they will be picked up. |
| `actualPickupPoint` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`)`` Input only. The actual location when and where customer was picked up. This field is for provider to provide feedback on actual pickup information. |
| `actualPickupArrivalPoint` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`)`` Input only. The actual time and location of the driver arrival at the pickup point. This field is for provider to provide feedback on actual arrival information at the pickup point. |
| `pickupTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Either the estimated future time when the rider(s) will be picked up, or the actual time when they were picked up. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `intermediateDestinations[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TerminalLocation`)`` Intermediate stops in order that the trip requests (in addition to pickup and dropoff). Initially this will not be supported for shared trips. |
| `intermediateDestinationsVersion` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Indicates the last time the `intermediateDestinations` was modified. Your server should cache this value and pass it in `UpdateTripRequest` when update `intermediateDestinationIndex` to ensure the `intermediateDestinations` is not changed. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `intermediateDestinationIndex` | `integer` When `TripStatus` is `ENROUTE_TO_INTERMEDIATE_DESTINATION`, a number between \[0..N-1\] indicating which intermediate destination the vehicle will cross next. When `TripStatus` is `ARRIVED_AT_INTERMEDIATE_DESTINATION`, a number between \[0..N-1\] indicating which intermediate destination the vehicle is at. The provider sets this value. If there are no `intermediateDestinations`, this field is ignored. |
| `actualIntermediateDestinationArrivalPoints[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`)`` Input only. The actual time and location of the driver's arrival at an intermediate destination. This field is for provider to provide feedback on actual arrival information at intermediate destinations. |
| `actualIntermediateDestinations[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`)`` Input only. The actual time and location when and where the customer was picked up from an intermediate destination. This field is for provider to provide feedback on actual pickup information at intermediate destinations. |
| `dropoffPoint` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TerminalLocation`)`` Location where customer indicates they will be dropped off. |
| `actualDropoffPoint` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#StopLocation`)`` Input only. The actual time and location when and where customer was dropped off. This field is for provider to provide feedback on actual dropoff information. |
| `dropoffTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Either the estimated future time when the rider(s) will be dropped off at the final destination, or the actual time when they were dropped off. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `remainingWaypoints[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TripWaypoint`)`` Output only. The full path from the current location to the dropoff point, inclusive. This path could include waypoints from other trips. |
| `vehicleWaypoints[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TripWaypoint`)`` This field supports manual ordering of the waypoints for the trip. It contains all of the remaining waypoints for the assigned vehicle, as well as the pickup and drop-off waypoints for this trip. If the trip hasn't been assigned to a vehicle, then Fleet Engine ignores this field. For privacy reasons, this field is only populated by the server on `trips.update` and `trips.create` calls, NOT on `trips.get` calls. |
| `route[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/LatLng`)`` Output only. Anticipated route for this trip to the first entry in remainingWaypoints. Note that the first waypoint may belong to a different trip. |
| `currentRouteSegment` | `string` Output only. An encoded path to the next waypoint. Note: This field is intended only for use by the Driver SDK and Consumer SDK. Decoding is not yet supported. |
| `currentRouteSegmentVersion` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Indicates the last time the route was modified. Note: This field is intended only for use by the Driver SDK and Consumer SDK. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `currentRouteSegmentTraffic` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/ConsumableTrafficPolyline`)`` Output only. Indicates the traffic conditions along the `currentRouteSegment` when they're available. Note: This field is intended only for use by the Driver SDK and Consumer SDK. |
| `currentRouteSegmentTrafficVersion` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Indicates the last time the `currentRouteSegmentTraffic` was modified. Note: This field is intended only for use by the Driver SDK and Consumer SDK. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `currentRouteSegmentEndPoint` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/TripWaypoint`)`` Output only. The waypoint where `currentRouteSegment` ends. |
| `remainingDistanceMeters` | `integer` Output only. The remaining driving distance in the `currentRouteSegment` field. The value is unspecified if the trip is not assigned to a vehicle, or the trip is completed or cancelled. |
| `etaToFirstWaypoint` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The ETA to the next waypoint (the first entry in the `remainingWaypoints` field). The value is unspecified if the trip is not assigned to a vehicle, or the trip is inactive (completed or cancelled). Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `remainingTimeToFirstWaypoint` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Output only. The duration from when the Trip data is returned to the time in `Trip.eta_to_first_waypoint`. The value is unspecified if the trip is not assigned to a vehicle, or the trip is inactive (completed or cancelled). A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `remainingWaypointsVersion` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Indicates the last time that `remainingWaypoints` was changed (a waypoint was added, removed, or changed). Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `remainingWaypointsRouteVersion` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Indicates the last time the `remainingWaypoints.path_to_waypoint` and `remainingWaypoints.traffic_to_waypoint` were modified. Your client app should cache this value and pass it in `GetTripRequest` to ensure the paths and traffic for `remainingWaypoints` are only returned if updated. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `numberOfPassengers` | `integer` Immutable. Indicates the number of passengers on this trip and does not include the driver. A vehicle must have available capacity to be returned in a `vehicles.search` response. |
| `lastLocation` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/VehicleLocation`)`` Output only. Indicates the last reported location of the vehicle along the route. |
| `lastLocationSnappable` | `boolean` Output only. Indicates whether the vehicle's `lastLocation` can be snapped to the currentRouteSegment. False if `lastLocation` or `currentRouteSegment` doesn't exist. It is computed by Fleet Engine. Any update from clients will be ignored. |
| `view` | ``enum (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripView`)`` The subset of Trip fields that are populated and how they should be interpreted. |
| `attributes[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#TripAttribute`)`` A list of custom Trip attributes. Each attribute must have a unique key. |

## TripStatus

The status of a trip indicating its progression.

| Enums ||
|---|---|
| `UNKNOWN_TRIP_STATUS` | Default, used for unspecified or unrecognized trip status. |
| `NEW` | Newly created trip. |
| `ENROUTE_TO_PICKUP` | The driver is on their way to the pickup point. |
| `ARRIVED_AT_PICKUP` | The driver has arrived at the pickup point. |
| `ARRIVED_AT_INTERMEDIATE_DESTINATION` | The driver has arrived at an intermediate destination and is waiting for the rider. |
| `ENROUTE_TO_INTERMEDIATE_DESTINATION` | The driver is on their way to an intermediate destination (not the dropoff point). |
| `ENROUTE_TO_DROPOFF` | The driver has picked up the rider and is on their way to the next destination. |
| `COMPLETE` | The rider has been dropped off and the trip is complete. |
| `CANCELED` | The trip was canceled prior to pickup by the driver, rider, or rideshare provider. |

## StopLocation

The actual location where a stop (pickup/dropoff) happened.

| JSON representation |
|---|
| ``` { "point": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/LatLng`) }, "timestamp": string, "stopTime": string } ``` |

| Fields ||
|---|---|
| `point` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/LatLng`)`` Required. Denotes the actual location. |
| `timestamp` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Indicates when the stop happened. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `stopTime (deprecated)` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` > [!WARNING] > This item is deprecated! Input only. Deprecated. Use the timestamp field. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## TripView

Selector for different sets of Trip fields in a `trips.get` response. See [AIP-157](https://google.aip.dev/157) for context. Additional views are likely to be added.

| Enums ||
|---|---|
| `TRIP_VIEW_UNSPECIFIED` | The default value. For backwards-compatibility, the API will default to an SDK view. To ensure stability and support, customers are advised to select a `TripView` other than `SDK`. |
| `SDK` | Includes fields that may not be interpretable or supportable using publicly available libraries. |
| `JOURNEY_SHARING_V1S` | Trip fields are populated for the Journey Sharing use case. This view is intended for server-to-server communications. |

## TripAttribute

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

| JSON representation |
|---|
| ``` { "key": string, // Union field `trip_attribute_value` can be only one of the following: "stringValue": string, "boolValue": boolean, "numberValue": number // End of list of possible types for union field `trip_attribute_value`. } ``` |

| Fields ||
|---|---|
| `key` | `string` The attribute's key. Keys may not contain the colon character (:). |
| Union field `trip_attribute_value`. The attribute's value, can be in string, bool, or double type. `trip_attribute_value` can be only one of the following: ||
| `stringValue` | `string` String typed attribute value. |
| `boolValue` | `boolean` Boolean typed attribute value. |
| `numberValue` | `number` Double typed attribute value. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips/create` | Creates a trip in the Fleet Engine and returns the new trip. |
| ### `https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips/delete` | Deletes a single Trip. |
| ### `https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips/get` | Get information about a single trip. |
| ### `https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips/search` | Get all the trips for a specific vehicle. |
| ### `https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips/update` | Updates trip data. |