Update Guest Trip
PUThttps://api.uber.com/v1/guests/trips/{trip_id}
¶ 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 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 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 |
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. |
stops |
array |
(Optional) An array of objects containing the location of the trip’s intermediate stops. (Supported for all ride types) |
stops[].latitude |
float |
(Required if setting stops ) The intermediate stop latitude |
stops[].longitude |
float |
(Required if setting stops ) The intermediate stop longitude |
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. |
additional_guests |
array |
Array of additional guests (guests ) of the trip. Does not include the host rider. (Supported for all ride types except Hourly) |
additional_guests[].guest_id |
string |
(Optional) Unique identifier of a rider. |
additional_guests[].first_name |
string |
(Required if setting additional_guests and additional_guests[].guest_id is omitted) Additional Guest’s first name. |
additional_guests[].last_name |
string |
(Required if setting additional_guests and additional_guests[].guest_id is omitted) Additional Guest’s last name. |
additional_guests[].email |
string |
(Optional) Additional Guest’s email address. |
additional_guests[].phone_number |
string |
(Required if setting additional_guests and additional_guests[].guest_id is omitted) Additional Guest’s Phone number in E.164 (international) format. |
additional_guests[].locale |
string |
(Optional) The locale the rider was created in. Defaults to en. |
¶ 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
},
"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 | Authorization failed. The client lacks valid auth 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. |
500 | internal_server_error | An unexpected error occurred on the server while processing the request. |