Three lines

Uber

Developers

Create Sandbox Run

POSThttps://sandbox-api.uber.com/v1/sandbox/terminal-state-trip-run

Use case

Use this endpoint to create a sandbox run for mocking a terminal state trip. You can select from available scenarioIDs for simulating desired kind of trip. Note that this endpoint is only available to be invoked from sandbox environment.

Test rider account will be configured and provided by Uber for Business representative.

Available Scenarios
Name Type Description
COMPLETED_STATE_TRIP string Simulates a completed trip at provided location.
Authorization

OAuth 2.0 Bearer token with the business.receipts scope.

Request
Example request
curl -X POST \
  -H 'authorization: Bearer <access_token>' \
  -H 'content-type: application/json' \
  -d '{
        "pickup": {
          "point": {
            "latitude": 37.34214,
            "longitude": -121.9096
          }
        },
        "dropoff": {
          "point": {
            "latitude": 37.2028,
            "longitude": -121.8521
          }
        },
        "rider_info": {
          "identifier": {
            "email_address": "uber+sandbox+test@uber.com"
          }
        },
        "scenario": {
          "id": "COMPLETED_STATE_TRIP"
        },
        "product_type": "UBERX",
        "expense_info": {
          "code": "xx",
          "memo": "xxx"
        }
    }' \
    'https://sandbox-api.uber.com/v1/sandbox/terminal-state-trip-run'
Request body parameters
Name Type Description Required?
pickup.point object Specifies the pickup location for the trip. Currently available only in San francisco Bay area locations. yes
pickup.point.latitude float The pickup location latitude for the trip. yes
pickup.point.longitude float The pickup location longitude for the trip. yes
dropoff.point object Specifies the dropoff location for the trip. Currently available only in San francisco Bay area locations. yes
dropoff.point.latitude float The dropoff location latitude for the trip. yes
dropoff.point.longitude float The dropoff location longitude for the trip. yes
rider_info object Specifies the test rider information for the trip. yes
rider_info.identifier object Specifies the test rider identifier for the trip. yes
rider_info.identifier.email_address string specifies the email address of the test rider taking the trip. yes
scenario.id enum Scenario depicting type of trip to be simulated. Allowed values: COMPLETED_STATE_TRIP yes
product_type enum Specifies the product type trip. Allowed values: UBERX yes
expense_info object Specifies any expense info to be set on the trip receipt. no
expense_info.code string Specifies the expense code to be set on the business trip. no
expense_info.memo string Specifies the expense memo to be set on the business trip. no
Response
Example response:
{
  "run_id": "<run_id>",
  "trip_id": "<trip_id>"
}
Response body parameters
Field Type Description
run_id string A unique identifier of a sandbox create run request.
trip_id string A unique identifier for the simulated trip. This can be used to fetch receipt once the trip run is completed.
Errors
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.
404 NOT_FOUND Suggests that the server was unable to find requested runID
500 INTERNAL_SERVER_ERROR Represents an unanticipated error occurred on the server side while processing the request.

Uber

Developers
© 2023 Uber Technologies Inc.