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
Use this endpoint to search active and past trips.
Authorization
OAuth 2.0 Bearer token with the required scope (business.trips, )
Request Parameters
Name |
Type |
Description |
third_party_customer_organization_id |
string |
Specifies the third party customer (3pc) organization. |
search_filters |
object |
Search filters based on which trips are fetched. |
search_filters.user_identifiers |
array |
Rider data for searching trips. |
search_filters.user_identifiers.email_address |
string |
Rider email for searching trips. |
search_filters.user_identifiers.phone_number |
string |
Rider phone number for searching trips. |
search_filters.trip_statuses |
array |
Trip statuses filter for searching trips. |
search_filters.interval |
object |
Time range for searching trips. |
search_filters.interval.starts_at |
number |
Start timestamp in epoch milliseconds for searching trips. |
search_filters.interval.ends_at |
number |
End timestamp in epoch milliseconds for searching trips. |
paging_option |
object |
Paging option for fetching next set of trips or fixed number of matching trips. |
paging_option.limit |
number |
Paging option for fetching fixed number of matching trips. |
paging_option.page_token |
string |
Paging option for fetching next set of trips from last page. |
trip_statuses filter values
Status |
Description |
SCHEDULED |
Fetch trips scheduled in future. |
ONGOING |
Fetch trips currently in progress. |
PAST |
Fetch past trips. |
Request
Example request for scheduled trips
When supplied with authcode token, it will fetch user trips.
When supplied with client credentials token, it will fetch trips taken for this U4B organization.
curl -X POST \
-H "authorization: Bearer $UBER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"request": {
"search_filters": {
"user_identifiers": [],
"trip_statuses": [
"SCHEDULED"
]
},
"paging_option": {
"limit": 100
}
}
}' \
'https://api.uber.com/v1/trips/search'
When supplied with client credentials token and user_identifiers it will filter the trips for this user.
curl -X POST \
-H "authorization: Bearer $UBER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"request": {
"search_filters": {
"user_identifiers": [
"email_address": "employee.a@xyz.com"
],
"trip_statuses": [
"PAST"
]
},
"paging_option": {
"page_token": "<page_token>"
"limit": 100
}
}
}' \
'https://api.uber.com/v1/trips/search'
Response Fields
Example response
{
"trips": [
{
"order_id": "f1311c8c-c720-46c3-8334-2fcdd730040d",
"trip_id": "a1211c8c-c720-46c3-8534-2ffdd730040d",
"trip_status": "SCHEDULED",
"requested_at": 1695883483000
},
{
"order_id": "b1351c8c-c620-46c3-8334-2fcdd730040d",
"trip_id": "f1281c8c-c520-46c3-8534-2ffdd730050d",
"trip_status": "IN_PROGRESS",
"requested_at": 1695883483000,
"start_at": 1695883583000
},
{
"order_id": "c1351c8c-c920-46c3-8334-2fcdd730040d",
"trip_id": "a1201c8c-c710-46c3-8534-2ffdd730050d",
"trip_status": "COMPLETED",
"requested_at": 1695883483000,
"start_at": 1695883583000,
"end_at": 1695883683000
}
]
}
Trips object
Name |
Type |
Description |
order_id |
string |
Order ID for this trip request. |
trip_id |
string |
Trip ID for this trip request. |
trip_status |
string |
Trip status. |
requested_at |
number |
Timestamp in epoch milliseconds when the trip order was requested. |
start_at |
number |
Timestamp in epoch milliseconds when the trip started processing. |
end_at |
number |
Timestamp in epoch milliseconds when the trip ended. |
user_info |
object |
Rider user info. |
client_fare |
object |
Fare for the trip. |
user_info object
Name |
Type |
Description |
email_address |
string |
Rider email address. |
phone_number |
string |
Rider phone number. |
first_name |
string |
Rider first name. |
last_name |
string |
Rider last name. |
fare object
Name |
Type |
Description |
currency_code |
string |
Currency code. |
total |
number |
Total value for the fare. |
range |
object |
Range fare which is not finalized yet for scheduled or in progress trips in some markets. |
fare.range object
Name |
Type |
Description |
min_fare |
number |
Minimum fare for the trip. |
max_fare |
number |
Maximum fare for the trip. |
paging_result object
Name |
Type |
Description |
next_page_token |
string |
Key used to request the next page of results. An empty value indicates there are no more records to paginate. |
Error Responses
HTTP Status |
Code |
Description |
400 |
BAD_REQUEST |
Suggests that the server was unable to understand or process the request due to its incorrect or malformed structure. |
403 |
FORBIDDEN |
Indicates that the server understood the request but refuses to authorize it. |
500 |
INTERNAL_SERVER_ERROR |
Represents an unanticipated error occurred on the server side while processing the request. |