Three lines

Uber

Developers

Sandbox

The Drivers sandbox provides development endpoints for testing the functionality of an application without making calls to the production Uber platform. All requests made to the sandbox environment will be ephemeral.

Requests to the sandbox environment should be made to:

https://sandbox-api.uber.com/<version>

All OAuth users and their access_tokens that are available in the production Uber API environment will also be valid to make requests to the sandbox. Please make sure that the OAuth 2.0 bearer token was granted the required scopes: partner.accounts, partner.payments, partner.trips.

Profile

The sandbox profile endpoint proxies requests directly to the production environment. It returns driver details based on their account.

Base URL https://sandbox-api.uber.com/<version>
Resource GET https://sandbox-api.uber.com/v1/partners/me
Authorization OAuth 2.0 bearer token with the partner.accounts scope.

Example Request

Try It Fetch profile for a driver.

curl 'https://sandbox-api.uber.com/v1/partners/me' \
-H 'Authorization: Bearer <TOKEN>'

Response

Status-Code: 200 OK

{
  "driver_id": "8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==",
  "first_name": "Uber",
  "last_name": "Tester",
  "email": "uber.developer+tester@example.com",
  "phone_number": "+14155550000",
  "picture": "https://d1w2poirtb3as9.cloudfront.net/16ce502f4767f17b120e.png",
  "promo_code": "ubert4544ue",
  "rating": 5,
  "activation_status": "active"
}

Payments

The payments endpoint returns a static response for testing integrations before deploying to production. The sample response returns a set of payments and represents what you can expect from production responses.

Base URL https://sandbox-api.uber.com/<version>
Resource GET https://sandbox-api.uber.com/v1/partners/payments
Authorization OAuth 2.0 bearer token with the partner.payments scope.

Example Request

Try It Fetch payments for a driver.

curl 'https://sandbox-api.uber.com/v1/partners/payments' \
-H 'Authorization: Bearer <TOKEN>'

Response

Status-Code: 200 OK

{
  "count": 5,
  "limit": 10,
  "payments": [
    {
      "payment_id": {},
      "category": "fare",
      "event_time": 1504742400,
      "trip_id": "02d54c38-f3f4-4c5e-8573-b77f6b8f285f",
      "cash_collected": 0,
      "amount": 4.09,
      "driver_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "breakdown": {
        "other": 3.87,
        "service_fee": -1.36,
        "toll": 1.58
      },
      "rider_fees": {},
      "partner_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "currency_code": "USD"
    },
    {
      "payment_id": {},
      "category": "promotion",
      "event_time": 1504656000,
      "trip_id": null,
      "cash_collected": null,
      "amount": 20,
      "driver_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "breakdown": {
        "other": 20
      },
      "rider_fees": {},
      "partner_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "currency_code": "USD"
    },
    {
      "payment_id": {},
      "category": "other",
      "event_time": 1504569600,
      "trip_id": null,
      "cash_collected": null,
      "amount": 20,
      "driver_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "breakdown": {
        "other": 20
      },
      "rider_fees": {},
      "partner_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "currency_code": "USD"
    },
    {
      "payment_id": {},
      "category": "fare",
      "event_time": 1504483200,
      "trip_id": "14bf225b-5d66-427b-aff7-98d6abf6cceb",
      "cash_collected": 0,
      "amount": 20.45,
      "driver_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "breakdown": {
        "other": 22.13,
        "service_fee": -5.53,
        "toll": 3.85
      },
      "rider_fees": {},
      "partner_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "currency_code": "USD"
    },
    {
      "payment_id": {},
      "category": "fare",
      "event_time": 1504396800,
      "trip_id": "029ff949-61db-4eee-95c8-65a6de105e8a",
      "cash_collected": 0,
      "amount": 5.63,
      "driver_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "breakdown": {
        "other": 7.51,
        "service_fee": -1.88
      },
      "rider_fees": {},
      "partner_id": "8JwJb9wL4aaSbRZTZRqfMXCWnuV2QOe6m34da31Dz1XvLBsbiCxQEZ5MM7Rnw0vldZYqjkDT0xJKOvyQVUIh_s5cqe8p82p9hKuau4xSn09aquJXbicNtopD84e9AQXYGQ==",
      "currency_code": "USD"
    }
  ],
  "offset": 0
}

Trips

The trips endpoint returns a static response for testing integrations before deploying to production. The static sandbox response returns a set of trips and represents what you can expect from production responses.

Base URL https://sandbox-api.uber.com/<version>
Resource GET https://sandbox-api.uber.com/v1/partners/trips
Authorization OAuth 2.0 bearer token with the partner.trips scope.

Example Request

Try It Fetch trips for a driver.

curl 'https://sandbox-api.uber.com/v1/partners/trips' \
-H 'Authorization: Bearer <TOKEN>'

Response

Status-Code: 200 OK

{
    "count": 6,
    "limit": 10,
    "trips": [{
        "fare": 0.0,
        "dropoff": {
            "timestamp": 1444351179
        },
        "vehicle_id": "4e4c9a14-edfd-41f7-9752-f4a95c04d705",
        "distance": 0.0,
        "start_city": {
            "latitude": 37.7749,
            "display_name": "San Francisco",
            "longitude": -122.4194
        },
        "status_changes": [{
            "status": "accepted",
            "timestamp": 1470857172
        }, {
            "status": "driver_arrived",
            "timestamp": 1470857174
        }, {
            "status": "trip_began",
            "timestamp": 1470857233
        }, {
            "status": "driver_canceled",
            "timestamp": 1470857245
        }],
        "surge_multiplier": 1.0,
        "pickup": {
            "timestamp": 1444351179
        },
        "driver_id": "8GhJMmFh8fxRCsIlzf8kY12cJx97COSXldXaCHRLfha_7UM8jyR3SVJyGSaV-eFlXpf2Fa6rAo15bQ_gkHq-5lS5D9CaCmHRTjycmUxiaC0ee1iTlJ1v7R5GydCONS46IA==",
        "status": "driver_canceled",
        "duration": 0,
        "trip_id": "e07165b6-9c93-4ba9-b90b-d5e771753436",
        "currency_code": "USD"
    }, {
        "fare": 0.0,
        "dropoff": null,
        "vehicle_id": "70a60c03-8ea4-4350-b62d-393217897390",
        "distance": 0.0,
        "start_city": {
            "latitude": 37.7749,
            "display_name": "San Francisco",
            "longitude": -122.4194
        },
        "status_changes": [{
            "status": "accepted",
            "timestamp": 1466193454
        }, {
            "status": "driver_arrived",
            "timestamp": 1466193456
        }, {
            "status": "trip_began",
            "timestamp": 1466193474
        }, {
            "status": "driver_canceled",
            "timestamp": 1466193561
        }],
        "surge_multiplier": 1.0,
        "pickup": null,
        "driver_id": "8GhJMmFh8fxRCsIlzf8kY12cJx97COSXldXaCHRLfha_7UM8jyR3SVJyGSaV-eFlXpf2Fa6rAo15bQ_gkHq-5lS5D9CaCmHRTjycmUxiaC0ee1iTlJ1v7R5GydCONS46IA==",
        "status": "driver_canceled",
        "duration": 0,
        "trip_id": "99a96661-f20b-4daf-ade5-407f415118fa",
        "currency_code": "USD"
    }, {
        "fare": 5.0,
        "dropoff": null,
        "vehicle_id": "70a60c03-8ea4-4350-b62d-393217897390",
        "distance": null,
        "start_city": {
            "latitude": 37.7749,
            "display_name": "San Francisco",
            "longitude": -122.4194
        },
        "status_changes": [{
            "status": "accepted",
            "timestamp": 1466039552
        }, {
            "status": "rider_canceled",
            "timestamp": 1466045493
        }],
        "surge_multiplier": 1.0,
        "pickup": null,
        "driver_id": "8GhJMmFh8fxRCsIlzf8kY12cJx97COSXldXaCHRLfha_7UM8jyR3SVJyGSaV-eFlXpf2Fa6rAo15bQ_gkHq-5lS5D9CaCmHRTjycmUxiaC0ee1iTlJ1v7R5GydCONS46IA==",
        "status": "rider_canceled",
        "duration": 0,
        "trip_id": "aa3fd037-6336-4b80-9fc6-325dff69e4ff",
        "currency_code": "USD"
    }, {
        "fare": null,
        "dropoff": null,
        "vehicle_id": "ce08845d-18c1-4e03-b58b-131538e181ca",
        "distance": null,
        "start_city": {
            "latitude": 37.7749,
            "display_name": "San Francisco",
            "longitude": -122.4194
        },
        "status_changes": [{
            "status": "accepted",
            "timestamp": 1463197077
        }, {
            "status": "driver_arrived",
            "timestamp": 1463197081
        }, {
            "status": "rider_canceled",
            "timestamp": 1463197088
        }],
        "surge_multiplier": 1.0,
        "pickup": {
            "timestamp": 1463197081
        },
        "driver_id": "8GhJMmFh8fxRCsIlzf8kY12cJx97COSXldXaCHRLfha_7UM8jyR3SVJyGSaV-eFlXpf2Fa6rAo15bQ_gkHq-5lS5D9CaCmHRTjycmUxiaC0ee1iTlJ1v7R5GydCONS46IA==",
        "status": "rider_canceled",
        "duration": 0,
        "trip_id": "a76e9c38-0869-4c84-992e-ad2be643b62f",
        "currency_code": "USD"
    }, {
        "fare": 7.82,
        "dropoff": {
            "timestamp": 1455912051
        },
        "vehicle_id": "e6d1e6e8-fb19-49b5-b0a9-690672dab458",
        "distance": 0.0,
        "start_city": {
            "latitude": 37.7749,
            "display_name": "San Francisco",
            "longitude": -122.4194
        },
        "status_changes": [{
            "status": "accepted",
            "timestamp": 1455910811
        }, {
            "status": "driver_arrived",
            "timestamp": 1455910831
        }, {
            "status": "trip_began",
            "timestamp": 1455910832
        }, {
            "status": "completed",
            "timestamp": 1455912051
        }],
        "surge_multiplier": 1.0,
        "pickup": {
            "timestamp": 1455910832
        },
        "driver_id": "8GhJMmFh8fxRCsIlzf8kY12cJx97COSXldXaCHRLfha_7UM8jyR3SVJyGSaV-eFlXpf2Fa6rAo15bQ_gkHq-5lS5D9CaCmHRTjycmUxiaC0ee1iTlJ1v7R5GydCONS46IA==",
        "status": "completed",
        "duration": 1220,
        "trip_id": "e33f756b-16e9-4cb4-96d4-ef0d0e5c9838",
        "currency_code": "USD"
    }, {
        "fare": null,
        "dropoff": null,
        "vehicle_id": "70a60c03-8ea4-4350-b62d-393217897390",
        "distance": null,
        "start_city": {
            "latitude": 37.7749,
            "display_name": "San Francisco",
            "longitude": -122.4194
        },
        "status_changes": [{
            "status": "accepted",
            "timestamp": 1454890629
        }, {
            "status": "driver_arrived",
            "timestamp": 1454890630
        }, {
            "status": "rider_canceled",
            "timestamp": 1454890635
        }],
        "surge_multiplier": 1.4,
        "pickup": {
            "timestamp": 1454890630
        },
        "driver_id": "8GhJMmFh8fxRCsIlzf8kY12cJx97COSXldXaCHRLfha_7UM8jyR3SVJyGSaV-eFlXpf2Fa6rAo15bQ_gkHq-5lS5D9CaCmHRTjycmUxiaC0ee1iTlJ1v7R5GydCONS46IA==",
        "status": "rider_canceled",
        "duration": 0,
        "trip_id": "4c4308d7-e21b-4a5c-8219-98be818874ff",
        "currency_code": "USD"
    }],
    "offset": 0
}

Modify sandbox Trips (optional)

The trips endpoint returns a static response for testing integrations before deploying to production. The response can be modified in the sandbox to test various scenarios, but is not validated.

You can modify trips using this endpoint, but it lacks any validation. Any json posted will be returned even if invalid.

Base URL https://sandbox-api.uber.com/<version>
Resource PUT https://sandbox-api.uber.com/v1/sandbox/partners/trips
Authorization OAuth 2.0 bearer token with the partner.trips scope.

Payload

This example sets the response of sandbox trips endpoint to the value:

{
  "count": 1200,
  "limit": 1,
  "trips": [
    {
      "fare": 6.2,
      "dropoff": {
        "timestamp": 1502844378
      },
      "vehicle_id": "0082b54a-6a5e-4f6b-b999-b0649f286381",
      "distance": 0.37,
      "start_city": {
        "latitude": 38.3498,
        "display_name": "Charleston, WV",
        "longitude": -81.6326
      },
      "status_changes": [
        {
          "status": "accepted",
          "timestamp": 1502843899
        },
        {
          "status": "driver_arrived",
          "timestamp": 1502843900
        },
        {
          "status": "trip_began",
          "timestamp": 1502843903
        },
        {
          "status": "completed",
          "timestamp": 1502844378
        }
      ],
      "surge_multiplier": 1,
      "pickup": {
        "timestamp": 1502843903
      },
      "driver_id": "8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==",
      "status": "completed",
      "duration": 475,
      "trip_id": "b5613b6a-fe74-4704-a637-50f8d51a8bb1",
      "currency_code": "USD"
    }
  ],
  "offset": 0
}

Example Request

Try It Modify sandbox trips for a driver.

curl -X PUT 'https://sandbox-api.uber.com/v1/sandbox/partners/trips' \
     -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer <TOKEN>' \
     -d '{"count": 1200,"limit": 1,"trips": [{"fare": 6.2,"dropoff": {"timestamp": 1502844378},"vehicle_id": "0082b54a-6a5e-4f6b-b999-b0649f286381","distance": 0.37,"start_city": {"latitude": 38.3498,"display_name": "Charleston, WV","longitude": -81.6326},"status_changes": [{"status": "accepted","timestamp": 1502843899},{"status": "driver_arrived","timestamp": 1502843900},{"status": "trip_began","timestamp": 1502843903},{"status": "completed","timestamp": 1502844378}],"surge_multiplier": 1,"pickup": {"timestamp": 1502843903},"driver_id": "8LvWuRAq2511gmr8EMkovekFNa2848lyMaQevIto-aXmnK9oKNRtfTxYLgPq9OSt8EzAu5pDB7XiaQIrcp-zXgOA5EyK4h00U6D1o7aZpXIQah--U77Eh7LEBiksj2rahB==","status": "completed","duration": 475,"trip_id": "b5613b6a-fe74-4704-a637-50f8d51a8bb1","currency_code": "USD"}],"offset": 0}'

Response

Status-Code: 204 No Content

Error responses

Error Code Description
401 unauthorized Invalid OAuth 2.0 credentials provided. You must have an access_token with all required scopes.
409 forbidden The account used for authentication is not a driver account.

Uber

Developers
© 2023 Uber Technologies Inc.