Three lines

Uber

Developers

Update Guest Trip

PUThttps://api.uber.com/v1/guests/trips/{trip_id}

Privileged and Confidential This endpoint design has been confidentially shared with you. It is still under development and is subject to change without notice. Please do not share this document or API endpoint details with anyone who is not authorized to have access. For more information read about scopes.

Use Case

Makes changes to a trip, which will be updated to whatever values are set for each field in the request. This means that not setting certain fields will delete any existing values for those fields.

If the request is from a third party (3P) app, please add x-uber-organizationuuid header and the Organization UUID as the value or the request will be denied.

NOTE: Update trip feature is only available for On-demand trips at the moment. Update is not supported yet for Scheduled/Flex/Reserve trip types.

To update an active ride (a trip dispatched to a driver)

Only the destination and intermediate stops can be updated for active rides. You will need to ensure any fields other than the destination and the requested stops are the same as what they were set to when the trip was created. You can call GET /v1/guests/trips/{request_id} to retrieve those fields.

After updating them, subsequent calls to GET /v1/guests/trips/{request_id} will show the latest destination and requested stops updated in the destination and stop fields of the response.

Note: Intermediate stops can only be updated for an hourly ride and are not available for point-to-point trips. Hourly rides are only available in certain regions via API.

Authorization

OAuth 2.0 Bearer token with the guests.trips scope.

Request Parameters
Name Type Description
trip_id string (Required) The unique ID of the ride request.
end_location object (Required) All fields can be updated before a trip has reached a terminal state. Object containing destination details.
end_location.latitude float (Required) The destination latitude
end_location.longitude float (Required) The destination longitude
end_location.address string (Required) The destination address
end_location.place struct (Optional) This controls the address shown to the driver. If not set, the address shown will be reverse geocoded by Uber using the latitude/longitude.
end_location.place.place_id string (Required if setting place) The place ID in provider’s namespace.
end_location.place.provider string (Required if setting place) The name of a provider of location data, e.g. google_places
end_location.place.zone_id string An identifier for the zone, if applicable.
end_location.title string A brief title or name for the dropoff location.
end_location.subtitle string A subtitle or additional information about the dropoff location.
expense_memo string (Optional) Can only be updated before a trip has been dispatched to a driver.
note_for_driver string (Optional) Can only be updated before a trip has been dispatched to a driver.
product_id string (Required) The unique ID of the product being requested. Product IDs for a specific area can be retrieved using the /v1/guests/trips/estimates API. Can only be updated for a flexible ride before the trip has been redeemed by the rider.
requested_stops array (Optional) An array of objects containing the location of the trip’s intermediate stops.
requested_stops[].latitude float (Required if setting requested_stops) The intermediate stop latitude
requested_stops[].longitude float (Required if setting requested_stops) The intermediate stop longitude
requested_stops[].place struct (Optional) This controls the address shown to the driver. If not set, the address shown will be reverse geocoded by Uber using the latitude/longitude.
requested_stops[].place.place_id string (Required if setting place) The place ID in provider’s namespace.
requested_stops[].place.provider string (Required if setting place) The name of a provider of location data, e.g. google_places
requested_stops[].place.address string The intermediate stop’s complete address.
requested_stops[].place.title string The intermediate stop street address.
requested_stops[].place.subtitle string The intermediate stop’s city and state, where applicable.
start_location object (Required) Can only be changed for flexible rides before they have been redeemed. Object containing pickup location details.
start_location.latitude float (Required) The pickup location latitude.
start_location.longitude float (Required) The pickup location longitude.
start_location.address string (Required) The pickup location address.
start_location.place struct (Optional) This controls the address shown to the driver. If not set, the address shown will be reverse geocoded by Uber using the latitude/longitude.
start_location.place.place_id string (Required if setting place) The place ID in provider’s namespace.
start_location.place.provider string (Required if setting place) The name of a provider of location data, e.g. google_places
start_location.place.zone_id string An identifier for the zone, if applicable.
start_location.title string A brief title or name for the pickup location.
start_location.subtitle string A subtitle or additional information about the pickup location.
Example Request
  curl -X PUT \
    -H "authorization: Bearer $UBER_TOKEN" \
    -H 'content-type: application/json' \
    -d '{
      "start_location": {
        "latitude": 40.753,
        "longitude": -73.9867
      },
      "end_location": {
        "latitude": 40.7484,
        "longitude": -73.9857
      },
      "requested_stops": [
        {
          "latitude": 40.7284,
          "longitude": -73.9357
        },
        {
          "latitude": 40.7322,
          "longitude": -73.9682
        }
      ],
      "product_id":"b8e5c464-5de2-4539-a35a-986d6e58f186"
    }' \
    https://api.uber.com/v1/guests/trips/{trip_id} | jq .

A successful request will receive a 200 with an empty response.

Expected Errors
{
  "code": "validation_failed",
  "data": {
    "invalid_field_changed": "start_location"
  },
  "message": "Only destination can be updated for active rides"
}
{
  "code": "bad_request",
  "message": "The ride that has reached a final state and cannot be updated."
}
{
  "message": "You can only adjust your pickup point within the area shown.",
  "data": {
    "statusCode": "400"
  },
  "errCode": "pickup_cannot_be_updated"
}
{
  "message": "Sorry, you are not eligible for a pickup location change!",
  "data": {
    "statusCode": "400"
  },
  "errCode": "pickup_cannot_be_updated"
}
Internal Server Errors
{
  "message": "Something went wrong - please try again.",
  "data": {
    "statusCode": "500"
  },
  "errCode": "internal_server_error"
}
Endpoint Possible Errors
HTTP Status Code Description
400 validation_failed This error occurs when the product_id field is omitted in the request body. product_id is a mandatory field when updating a guest trip.
400 no_product_found This error occurs when a product_id different from the one used during the trip creation. To avoid this error, ensure the same product_id used during trip creation is passed when updating the trip
401 unauthorized Authentication failed. The client lacks valid authentication credentials for the requested resource.
403 forbidden The client does not have permission to access the requested resource.
404 not_found The requested resource or entity could not be found on the server or in the database.
500 internal_server_error An unexpected error occurred on the server while processing the request.

Uber

Developers
© 2023 Uber Technologies Inc.