swagger: "2.0"
schemes:
  - https
host: api.lyft.com
basePath: /v1
info:
  contact:
    email: api-support@lyft.com
    name: Lyft
    url: http://developer.lyft.com
  description: Drive your app to success with Lyft's API
  title: Lyft
  version: 1.0.0
  x-apisguru-categories:
    - location
  x-logo:
    url: https://twitter.com/lyft/profile_image?size=original
  x-origin:
    - format: swagger
      url: https://api.lyft.com/v1/spec
      version: "2.0"
  x-providerName: lyft.com
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  Client Authentication:
    description: OAuth 2.0 - Application Only Credentials
    flow: application
    scopes:
      public: Access public information such as ETAs and cost estimates
    tokenUrl: https://api.lyft.com/oauth/token
    type: oauth2
  User Authentication:
    authorizationUrl: https://api.lyft.com/oauth/authorize
    description: OAuth 2.0 - User Credentials
    flow: accessCode
    scopes:
      profile: Access profile information about the user
      public: Access public information such as ETAs and cost estimates
      rides.read: Access information about the user's current and past rides
      rides.request: |
        Request a ride for the user. Cancel an existing request.
    tokenUrl: https://api.lyft.com/oauth/token
    type: oauth2
security:
  - Client Authentication:
      - public
  - User Authentication:
      - public
parameters:
  LatParam:
    description: Latitude of a location
    format: double
    in: query
    name: lat
    required: true
    type: number
  LngParam:
    description: Longitude of a location
    format: double
    in: query
    name: lng
    required: true
    type: number
  OptionalDestLatParam:
    description: Latitude of destination location
    format: double
    in: query
    name: destination_lat
    required: false
    type: number
  OptionalDestLngParam:
    description: Longitude of destination location
    format: double
    in: query
    name: destination_lng
    required: false
    type: number
  OptionalEndTime:
    description: |
      Restrict to rides starting before this point in time. The earliest supported date is 2015-01-01T00:00:00+00:00
    format: date-time
    in: query
    name: end_time
    required: false
    type: string
  OptionalLimit:
    default: 10
    description: |
      The maximum number of rides to return. The default limit is 10 if not specified. The maximum allowed value is 50, an integer greater that 50 will return at most 50 results.
    exclusiveMaximum: false
    exclusiveMinimum: true
    format: int32
    in: query
    maximum: 50
    minimum: 0
    name: limit
    type: integer
  OptionalRideType:
    description: ID of a ride type
    enum:
      - lyft
      - lyft_line
      - lyft_plus
      - lyft_premier
      - lyft_lux
      - lyft_luxsuv
    in: query
    name: ride_type
    required: false
    type: string
  RideStatusParam:
    enum:
      - lyft
      - lyft_line
      - lyft_plus
      - lyft_premier
      - lyft_lux
      - lyft_luxsuv
    in: path
    name: ride_type
    required: true
    type: string
  StartTime:
    description: |
      Restrict to rides starting after this point in time. The earliest supported date is 2015-01-01T00:00:00+00:00
    format: date-time
    in: query
    name: start_time
    required: true
    type: string
tags:
  - description: Endpoints that do not require a user
    name: Public
  - description: Endpoints that require a user context
    name: User
  - description: Endpoints that manipulate the Lyft sandbox
    name: Sandbox
  - description: Endpoints that require special permission from Lyft to use
    name: Restricted
paths:
  /cost:
    get:
      description: |
        Estimate the cost of taking a Lyft between two points.
      operationId: GetCost
      parameters:
        - $ref: "#/parameters/OptionalRideType"
        - description: Latitude of the starting location
          format: double
          in: query
          name: start_lat
          required: true
          type: number
        - description: Longitude of the starting location
          format: double
          in: query
          name: start_lng
          required: true
          type: number
        - description: Latitude of the ending location
          format: double
          in: query
          name: end_lat
          required: false
          type: number
        - description: Longitude of the ending location
          format: double
          in: query
          name: end_lng
          required: false
          type: number
      responses:
        "200":
          description: An object with an array of cost estimates by ride type
          schema:
            properties:
              cost_estimates:
                items:
                  $ref: "#/definitions/CostEstimate"
                type: array
            title: CostEstimateResponse
            type: object
        "400":
          description: |
            The 'error' field will be one of the following:
             * `bad_parameter`: A validation error occurred
             * `no_service_in_area`: start location is not within a Lyft service area
             * `ridetype_unavailable_in_region`: ridetype not supported at this start location
          schema:
            $ref: "#/definitions/ApiError"
      summary: Cost estimates
      tags:
        - Public
  /drivers:
    get:
      description: |
        The drivers endpoint returns a list of nearby drivers' lat and lng at a given location.
      operationId: GetDrivers
      parameters:
        - $ref: "#/parameters/LatParam"
        - $ref: "#/parameters/LngParam"
      responses:
        "200":
          description: An object with an array of available drivers sorted by eta for the given location
          schema:
            properties:
              nearby_drivers:
                items:
                  $ref: "#/definitions/NearbyDriversByRideType"
                type: array
            title: NearbyDriversResponse
            type: object
        "400":
          description: A validation error occurred
          schema:
            $ref: "#/definitions/ApiError"
      summary: Available drivers nearby
      tags:
        - Public
  /eta:
    get:
      description: |
        The ETA endpoint lets you know how quickly a Lyft driver can come get you
      operationId: GetETA
      parameters:
        - $ref: "#/parameters/LatParam"
        - $ref: "#/parameters/LngParam"
        - $ref: "#/parameters/OptionalDestLatParam"
        - $ref: "#/parameters/OptionalDestLngParam"
        - $ref: "#/parameters/OptionalRideType"
      responses:
        "200":
          description: An object with an array of ETAs by ride type for the given location
          schema:
            properties:
              eta_estimates:
                items:
                  $ref: "#/definitions/Eta"
                type: array
            title: EtaEstimateResponse
            type: object
        "400":
          description: |
            The 'error' field will be one of the following:
             * `bad_parameter`: A validation error occurred
             * `no_service_in_area`: location is not within a Lyft service area
             * `ridetype_unavailable_in_region`: ridetype not supported at this location
          schema:
            $ref: "#/definitions/ApiError"
      summary: Pickup ETAs
      tags:
        - Public
  /profile:
    get:
      description: |
        The v1 of this endpoint returns the user's ID, v2 will return more general info about the user. We require authentication for this endpoint, so we extract the user ID from the access token.
      operationId: GetProfile
      responses:
        "200":
          description: User ID was found and returned
          schema:
            $ref: "#/definitions/Profile"
      security:
        - User Authentication:
            - profile
      summary: The user's general info
      tags:
        - User
  /rides:
    get:
      description: |
        Get a list of past & current rides for this passenger.
      operationId: GetRides
      parameters:
        - $ref: "#/parameters/StartTime"
        - $ref: "#/parameters/OptionalEndTime"
        - $ref: "#/parameters/OptionalLimit"
      responses:
        "200":
          description: |
            An object with an array of up to `limit` rides taken by the user between `start_time` and `end_time`.
          schema:
            properties:
              ride_history:
                items:
                  $ref: "#/definitions/RideDetail"
                type: array
            title: RidesResponse
            type: object
        "400":
          description: A validation error occurred
          schema:
            $ref: "#/definitions/ApiError"
      security:
        - User Authentication:
            - rides.read
      summary: List rides
      tags:
        - User
    post:
      description: |
        Request a Lyft come pick you up at the given location.
      operationId: NewRide
      parameters:
        - description: Ride request information
          in: body
          name: request
          required: true
          schema:
            $ref: "#/definitions/Ride"
      responses:
        "201":
          description: An object with high level ride information. Use `GET /v1/rides/{id}` for more details.
          schema:
            $ref: "#/definitions/RideRequest"
        "400":
          description: |
            The 'error' field can be one of the following:
             * `bad_parameter`: A validation error occurred
             * `no_service_in_area`: origin is not within a Lyft service area
             * `ridetype_unavailable_in_region`: ridetype not supported at origin
             * `primetime_confirmation_required`: user must accept primetime. A primetime confirmation token and
            details will be included in the response
             * `invalid_primetime_confirmation`: supplied token is invalid or expired
             * `destination_prohibited`: Lyft is not allowed to drop off at that destination (e.g. some airports).
             User-displayable details in the 'error_description' field
             * `client_error`: an uncategorized error. Details in the 'error_description' field
          schema:
            $ref: "#/definitions/RideRequestError"
        "403":
          description: |
            User or client does not have permission to complete this request. Specific errors include:
             * `user_payment_required`: The user does not have a valid payment method on file.
             They must use the Lyft app to add or update one.
             * `account_disabled`: The user's account has been suspended, and they must contact Lyft support.
             * `user_in_driver_mode`: The user is logged in as a driver and can't request rides until they log out
             * `verified_phone_required`: The user has not provided or verified their phone number.
             They can add one in the Lyft app
          schema:
            $ref: "#/definitions/ApiError"
        "409":
          description: |
            The 'error' field will be one of the following:
             * `no_drivers_available`: No drivers are available right now
             * `user_already_in_ride`: User cannot request a ride while in a ride
          schema:
            $ref: "#/definitions/ApiError"
      security:
        - User Authentication:
            - rides.request
      summary: Request a Lyft
      tags:
        - User
  "/rides/{id}":
    get:
      description: |
        Get the status of a ride along with information about the driver, vehicle and price of a given ride ID
      operationId: GetRide
      parameters:
        - description: The ID of the ride
          in: path
          name: id
          required: true
          type: string
      responses:
        "200":
          description: |
            Detailed ride information including ride status, driver information, passenger information, vehicle information, location information and price
          schema:
            $ref: "#/definitions/RideDetail"
        "403":
          description: User or client does not have permission to complete this request
          schema:
            $ref: "#/definitions/ApiError"
        "404":
          description: No ride found with provided ride ID
          schema:
            $ref: "#/definitions/ApiError"
      security:
        - User Authentication:
            - rides.read
      summary: Get the ride detail of a given ride ID
      tags:
        - User
  "/rides/{id}/cancel":
    post:
      description: |
        Cancel a ongoing ride which was requested earlier by providing the ride id.
      operationId: CancelRide
      parameters:
        - description: The ID of the ride
          in: path
          name: id
          required: true
          type: string
        - in: body
          name: request
          schema:
            $ref: "#/definitions/CancellationRequest"
      responses:
        "204":
          description: Successfully canceled the ride
        "400":
          description: |
            Cancellation token required
             * `cancel_confirmation_required`: a cancelation fee applies which the user must accept
             * `invalid_cancel_confirmation`: provided token was invalid or expired
          schema:
            $ref: "#/definitions/CancellationCostError"
        "403":
          description: User or client does not have permission to complete this request
          schema:
            $ref: "#/definitions/ApiError"
        "404":
          description: No ride found with provided ride ID
          schema:
            $ref: "#/definitions/ApiError"
        "409":
          description: You cannot cancel this ride
          schema:
            $ref: "#/definitions/ApiError"
      security:
        - User Authentication:
            - rides.request
      summary: Cancel a ongoing requested ride
      tags:
        - User
  "/rides/{id}/destination":
    put:
      description: |
        Add or update the ride's destination. Note that the ride must still be active (not droppedOff or canceled), and that destinations on Lyft Line rides can not be changed.
      operationId: SetRideDestination
      parameters:
        - description: The ID of the ride
          in: path
          name: id
          required: true
          type: string
        - description: The coordinates and optional address of the destination
          in: body
          name: request
          required: true
          schema:
            $ref: "#/definitions/Location"
      responses:
        "200":
          description: Successfully updated the destination. Returns the new destination.
          schema:
            $ref: "#/definitions/Location"
        "400":
          description: |
            The 'error' field will be one of the following:
             * `bad_parameter`: A validation error occurred
             * `invalid_destination`: Destination is generally invalid (eg. not in a Lyft service area)
             * `destination_prohibited`: Lyft drop-offs are not permitted at this location (eg. some airports).
             The 'error_description' field will contain an explaination suitable to display to the user.
             * `ride_is_lyft_line`: Cannot change the destination on Line rides
             * `ride_is_finished`: Ride has already been completed
          schema:
            $ref: "#/definitions/ApiError"
        "403":
          description: |
            User or client does not have permission to complete this request (`ride_does_not_belong_to_user`)
          schema:
            $ref: "#/definitions/ApiError"
        "404":
          description: No ride found with provided ride ID
          schema:
            $ref: "#/definitions/ApiError"
      security:
        - User Authentication:
            - rides.request
      summary: Update the destination of the ride
      tags:
        - User
  "/rides/{id}/rating":
    put:
      description: |
        Add the passenger's 1 to 5 star rating of the ride, optional written feedback, and optional tip amount in minor units and currency. The ride must already be dropped off, and ratings must be given within 24 hours of drop off. For purposes of display, 5 is considered the default rating. When this endpoint is successfully called, payment processing will begin.
      operationId: SetRideRating
      parameters:
        - description: The ID of the ride
          in: path
          name: id
          required: true
          type: string
        - description: The rating and optional feedback
          in: body
          name: request
          required: true
          schema:
            $ref: "#/definitions/RatingRequest"
      responses:
        "204":
          description: Successfully added the rating
        "400":
          description: |
            The 'error' field will be one of the following:
             * `bad_parameter`: A validation error occurred
             * `user_cannot_rate_this_ride`: Rides can only be rated once, within 24 hours of drop-off, and before
             the user starts another ride
             * `tip_too_large`: tip amount is too large for this ride
             * `tip_currency_not_accepted`: That tip currency is not accepted
          schema:
            $ref: "#/definitions/ApiError"
        "409":
          description: |
            The 'error' field will be:
             * `ride_not_finished`: Ride is still in progress (not yet in the droppedOff status)
          schema:
            $ref: "#/definitions/ApiError"
      security:
        - User Authentication:
            - rides.request
      summary: Add the passenger's rating, feedback, and tip
      tags:
        - User
  "/rides/{id}/receipt":
    get:
      description: |
        Get the receipt information of a processed ride by providing the ride id. Receipts will only be available to view once the payment has been processed. In the case of canceled ride, cancellation penalty is included if applicable.
      operationId: GetRideReceipt
      parameters:
        - description: The ID of the ride
          in: path
          name: id
          required: true
          type: string
      responses:
        "200":
          description: Detailed ride receipt information including cancel penalty if applicable.
          schema:
            $ref: "#/definitions/RideReceipt"
        "403":
          description: User or client does not have permission to complete this request
          schema:
            $ref: "#/definitions/ApiError"
        "404":
          description: No ride receipt found with provided ride ID
          schema:
            $ref: "#/definitions/ApiError"
      security:
        - User Authentication:
            - rides.read
      summary: Get the receipt of the rides.
      tags:
        - User
  /ridetypes:
    get:
      description: |
        The ride types endpoint returns information about what kinds of Lyft rides you can request at a given location.
      operationId: GetRideTypes
      parameters:
        - $ref: "#/parameters/LatParam"
        - $ref: "#/parameters/LngParam"
        - $ref: "#/parameters/OptionalRideType"
      responses:
        "200":
          description: An object with an array of available Ride Types for the given location
          schema:
            properties:
              ride_types:
                items:
                  $ref: "#/definitions/RideType"
                type: array
            title: RideTypesResponse
            type: object
        "400":
          description: A validation error occurred
          schema:
            $ref: "#/definitions/ApiError"
      summary: Types of rides
      tags:
        - Public
  /sandbox/primetime:
    put:
      description: |
        Preset a Prime Time percentage in the region surrounding the specified location. This Prime Time percentage will be applied when requesting cost, or when requesting a ride in sandbox mode.
      operationId: SetPrimeTime
      parameters:
        - description: Prime Time to be preset in the region surrounding the lat, lng
          in: body
          name: request
          required: true
          schema:
            $ref: "#/definitions/SandboxPrimetime"
      responses:
        "204":
          description: Successfully applied Prime Time in sandbox
        "400":
          description: Validation error occurred
          schema:
            $ref: "#/definitions/ApiError"
      summary: Preset Prime Time percentage
      tags:
        - Sandbox
  "/sandbox/rides/{id}":
    put:
      description: |
        Propagate a sandbox-ride through various ride status
      operationId: SetRideStatus
      parameters:
        - description: The ID of the ride
          in: path
          name: id
          required: true
          type: string
        - description: status to propagate the ride into
          in: body
          name: request
          required: true
          schema:
            $ref: "#/definitions/SandboxRideStatus"
      responses:
        "200":
          description: An object with the Ride ID and the new status
          schema:
            $ref: "#/definitions/SandboxRideUpdate"
        "400":
          description: Validation error occurred
          schema:
            $ref: "#/definitions/ApiError"
        "403":
          description: User or client does not have permission to complete this request
          schema:
            $ref: "#/definitions/ApiError"
      security:
        - User Authentication:
            - rides.request
      summary: Propagate ride through ride status
      tags:
        - Sandbox
  /sandbox/ridetypes:
    put:
      description: |
        The sandbox-ridetypes endpoint allows you to preset the ridetypes in the region surrounding the specified latitude and longitude to allow testing different scenarios
      operationId: SetRideTypes
      parameters:
        - description: Ridetypes to be preset in the region surrounding the lat, lng
          in: body
          name: request
          required: true
          schema:
            $ref: "#/definitions/SandboxRideType"
      responses:
        "200":
          description: An object listing the ridetypes at a given location
          schema:
            $ref: "#/definitions/SandboxRideType"
        "400":
          description: Validation error occurred
          schema:
            $ref: "#/definitions/ApiError"
      summary: Preset types of rides for sandbox
      tags:
        - Sandbox
  "/sandbox/ridetypes/{ride_type}":
    put:
      description: |
        Set driver availability for the provided ride_type in the city/region surrounding the specified location
      operationId: SetRideTypeAvailability
      parameters:
        - $ref: "#/parameters/RideStatusParam"
        - description: Driver availability to be preset in the region surrounding the lat, lng
          in: body
          name: request
          required: true
          schema:
            $ref: "#/definitions/SandboxDriverAvailability"
      responses:
        "204":
          description: Successfully set driver availability in sandbox
        "400":
          description: Validation error occurred
          schema:
            $ref: "#/definitions/ApiError"
        "404":
          description: ride_type provided in the path is not supported in the current area
          schema:
            $ref: "#/definitions/ApiError"
      summary: Driver availability for processing ride request
      tags:
        - Sandbox
definitions:
  ApiError:
    description: Details about why a request failed, such as missing or invalid parameters
    properties:
      error:
        description: A "slug" that serves as the error code (eg. "bad_parameter")
        type: string
      error_description:
        description: A user-friendly description of the error (appropriate to show to an end-user)
        type: string
      error_detail:
        items:
          $ref: "#/definitions/ErrorDetail"
        type: array
  CancellationCost:
    allOf:
      - $ref: "#/definitions/Cost"
      - properties:
          token:
            description: Token used to confirm the fee when cancelling a request
            type: string
          token_duration:
            description: How long, in seconds, before the token expires
            format: int32
            minimum: 0
            type: integer
        type: object
    type: object
  CancellationCostError:
    allOf:
      - $ref: "#/definitions/CancellationCost"
      - $ref: "#/definitions/ApiError"
    example:
      amount: 500
      currency: USD
      error: cancel_confirmation_required
      error_detail:
        - cancel_confirmation: a valid cancel_confirmation_token is required to cancel a ride
      token: 656a91d
      token_duration: 60
    type: object
  CancellationRequest:
    example:
      cancel_confirmation_token: 656a91d
    properties:
      cancel_confirmation_token:
        description: Token affirming the user accepts the cancellation fee. Required if a cancellation fee is in effect.
        type: string
  Charge:
    properties:
      amount:
        description: The line item amount
        format: int32
        type: integer
      currency:
        description: The currency for the amount
        type: string
      payment_method:
        description: The payment method display name.
        type: string
    required:
      - amount
      - currency
      - payment_method
  Cost:
    example:
      amount: 500
      currency: USD
      description: Total cost
    properties:
      amount:
        description: Total price of the ride
        format: int32
        type: integer
      currency:
        description: The ISO 4217 currency code for the amount (e.g. USD)
        type: string
      description:
        description: The description for the cost
        type: string
    required:
      - amount
      - currency
      - description
  CostEstimate:
    description: A non-guaranteed estimate of price
    example:
      cost_token: EupdCgIzy17lJoRmiO5
      display_name: Lyft
      estimated_cost_cents_max: 1080
      estimated_cost_cents_min: 1390
      estimated_distance_miles: 12.4
      estimated_duration_seconds: 540
      is_valid_estimate: true
      primetime_confirmation_token: EupdCgIzy17lJoRmiO5
      primetime_percentage: 25%
      ride_type: lyft
    properties:
      cost_token:
        description: A token that confirms the user has accepted current Prime Time and/or fixed price charges. See 'Request a Lyft' for more details
        type: string
      currency:
        description: The ISO 4217 currency code for the amount (e.g. 'USD')
        type: string
      display_name:
        description: A human readable description of the ride type
        type: string
      estimated_cost_cents_max:
        description: |
          Estimated upper bound for trip cost, in minor units (cents). Estimates are not guaranteed, and only provide a reasonable range based on current conditions.
        format: int32
        type: integer
      estimated_cost_cents_min:
        description: |
          Estimated lower bound for trip cost, in minor units (cents). Estimates are not guaranteed, and only provide a reasonable range based on current conditions.
        format: int32
        type: integer
      estimated_distance_miles:
        description: |
          Estimated distance for this trip
        format: double
        type: number
      estimated_duration_seconds:
        description: |
          Estimated time to get from the start location to the end.
        format: int32
        type: integer
      is_valid_estimate:
        description: The validity of the cost estimate returned
        type: boolean
      primetime_confirmation_token:
        description: This token is needed when requesting rides. (Deprecated)
        type: string
      primetime_percentage:
        description: |
          Current Prime Time Percentage. Prime Time adds a percentage to ride costs, prior to other applicable fees. When ride requests greatly outnumber available drivers, our system will automatically turn on Prime Time.
          If Prime Time is inactive, the value returned will be '0%'.
          Note: The returned estimate already has Prime Time factored in. The value is returned here for reference and to allow users to confirm/accept Prime Time prior to initiating a ride.
        type: string
      ride_type:
        $ref: "#/definitions/RideTypeEnum"
  CurrentRideLocation:
    allOf:
      - $ref: "#/definitions/LatLng"
      - properties:
          bearing:
            description: Bearing of the driver's car in degrees
            format: double
            type: number
        type: object
    example:
      bearing: 134.8789520264
      lat: 37.776157
      lng: -122.393817
    type: object
  DriverDetail:
    example:
      first_name: Joe
      image_url: http://example.com/lyft.png
      phone_number: "+15554445000"
      rating: "4.9"
      user_id: "123456789"
    properties:
      first_name:
        description: The driver's first name
        type: string
      image_url:
        description: The driver's image url
        type: string
      phone_number:
        description: |
          The driver's contact phone number. Must be E.164 formatted.
        format: phone
        type: string
      rating:
        description: The driver's rating based in 0-5 scale
        type: string
      user_id:
        description: The driver's id
        type: string
    required:
      - first_name
      - phone_number
      - rating
      - image_url
      - user_id
  ErrorDetail:
    description: |
      An object with a single key-value pair, where the key is the name of the invalid parameter, and the value is a description of the error.
    example:
      lat: (latitude) Missing required parameter in the query string
    properties:
      field_name:
        description: description of the error
        type: string
  Eta:
    description: Estimated Time of Arrival
    example:
      display_name: Lyft Line
      eta_seconds: 120
      is_valid_estimate: true
      ride_type: lyft_line
    properties:
      display_name:
        description: A human readable description of the ride type
        type: string
      eta_seconds:
        description: Estimated seconds for a driver to arrive
        format: int32
        type: integer
      eta_seconds_max:
        description: Estimated upper bound of seconds for a driver to arrive
        format: int32
        type: integer
      is_valid_estimate:
        description: The validity of the ETA estimate returned
        type: boolean
      ride_type:
        $ref: "#/definitions/RideTypeEnum"
  LatLng:
    example:
      lat: 36.9442175
      lng: -123.8679133
    properties:
      lat:
        description: The latitude component of a location
        format: double
        type: number
      lng:
        description: The longitude component of a location
        format: double
        type: number
    required:
      - lat
      - lng
  LineItem:
    properties:
      amount:
        description: The line item amount
        format: int32
        type: integer
      currency:
        description: The currency for the amount
        type: string
      type:
        description: The line item display name for a charge item
        type: string
    required:
      - type
      - amount
      - currency
  Location:
    allOf:
      - $ref: "#/definitions/LatLng"
      - properties:
          address:
            description: A human readable address at/near the given location
            type: string
        type: object
    example:
      address: 123 Main St, Anytown, CA
      lat: 36.9442175
      lng: -123.8679133
    type: object
  NearbyDriver:
    properties:
      locations:
        description: the lastest recorded driver locations up to 5 sorted in chronological order.
        items:
          $ref: "#/definitions/LatLng"
        type: array
  NearbyDriversByRideType:
    properties:
      drivers:
        description: list of nearby drivers group by ride type sorted by eta
        items:
          $ref: "#/definitions/NearbyDriver"
        type: array
      ride_type:
        description: driver's ride type. if driver is eligable for several ride types, he will be duplicated.
        type: string
  PassengerDetail:
    allOf:
      - $ref: "#/definitions/UserDetail"
      - properties:
          last_name:
            description: The passenger's last name
            type: string
          user_id:
            description: The passenger's lyft user id
            type: string
        type: object
    example:
      first_name: Jane
      image_url: https://public-api.lyft.com/static/images/user.png
      last_name: Doe
      rating: 4.9
    type: object
  PickupDropoffLocation:
    allOf:
      - $ref: "#/definitions/Location"
      - properties:
          time:
            description: Server time when the location object is created
            format: date-time
            type: string
        type: object
    example:
      address: 123 Main St, Anytown, CA
      lat: 36.9442175
      lng: -123.8679133
      time: 2015-09-24T23:26:25+00:00
    type: object
  PricingDetails:
    example:
      base_charge: 175
      cancel_penalty_amount: 500
      cost_minumum: 500
      cost_per_mile: 116
      cost_per_minute: 23
      currency: USD
      trust_and_service: 155
    properties:
      base_charge:
        description: The base charge of the trip
        format: int32
        type: integer
      cancel_penalty_amount:
        description: The charge amount if cancel penalty is involved
        format: int32
        type: integer
      cost_minimum:
        description: The minimum charge for the trip
        format: int32
        type: integer
      cost_per_mile:
        description: The cost per mile
        format: int32
        type: integer
      cost_per_minute:
        description: The cost per minute
        format: int32
        type: integer
      currency:
        description: The ISO 4217 currency code for the amount (e.g. USD)
        type: string
      trust_and_service:
        description: Service fee
        format: int32
        type: integer
  Profile:
    description: Represents the general information about a user.
    properties:
      first_name:
        description: The first name of this user
        type: string
      has_taken_a_ride:
        description: Indicates whether this user has taken at least one Lyft ride
        type: boolean
      id:
        description: The unique ID of this user
        type: string
      last_name:
        description: The last name of this user
        type: string
    required:
      - id
      - first_name
      - last_name
      - has_taken_a_ride
    type: object
  RatingRequest:
    description: Rating and optional feedback and tip
    example:
      feedback: Great ride!
      rating: 5
      tip:
        amount: 100
        currency: USD
    properties:
      feedback:
        description: The passenger's written feedback about this ride
        type: string
      rating:
        description: The passenger's rating of this ride from 1 to 5
        format: int32
        maximum: 5
        minimum: 1
        type: integer
      tip:
        allOf:
          - $ref: "#/definitions/TipParams"
        description: Tip amount in minor units and tip currency
        type: object
    required:
      - rating
  Ride:
    description: Represents a requested, ongoing, or finished Lyft ride
    properties:
      cost_token:
        description: A token that confirms the user has accepted current Prime Time and/or fixed price charges
        type: string
      destination:
        allOf:
          - $ref: "#/definitions/Location"
        description: The *requested* location for passenger drop off
        type: object
      origin:
        allOf:
          - $ref: "#/definitions/Location"
        description: The *requested* location for passenger pickup
        type: object
      primetime_confirmation_token:
        description: A token that confirms the user has accepted current primetime charges (Deprecated)
        type: string
      ride_type:
        $ref: "#/definitions/RideTypeEnum"
    required:
      - ride_type
      - origin
    type: object
  RideDetail:
    description: Detail information about a ride
    example:
      beacon_color: "#FFFFFF"
      destination:
        address: 987 Second St, Anytown, CA
        lat: 36.9453452
        lng: -123.8642521
      distance_miles: 16.2
      driver:
        first_name: Joe
        image_url: http://example.com/lyft.png
        phone_number: "+15554445111"
        rating: "4.9"
      dropoff:
        address: 987 Second St, Anytown, CA
        lat: 36.9453452
        lng: -123.8642521
        time: 2015-09-24T23:28:25+00:00
      duration_seconds: 1620
      line_items:
        - amount: 500
          currency: USD
          type: Ride
        - amount: 250
          currency: USD
          type: Prime Time
        - amount: 155
          currency: USD
          type: Service fee
      location:
        address: 987 Second St, Anytown, CA
        lat: 36.9453452
        lng: -123.8642521
      origin:
        address: 123 Main St, Anytown, CA
        lat: 36.9442175
        lng: -123.8679133
      passenger:
        first_name: Jane
        phone_number: "+15554445000"
        user_id: "776630198662493392"
      pickup:
        address: 123 Main St, Anytown, CA
        lat: 36.9442175
        lng: -123.8679133
        time: 2015-09-24T23:27:25+00:00
      price:
        amount: 905
        currency: USD
        description: Total ride price
      primetime_percentage: 50%
      requested_at: 2015-09-24T23:26:25+00:00
      ride_id: 123456789
      ride_profile: personal
      ride_type: lyft
      status: droppedOff
      vehicle:
        color: black
        image_url: http://example.com/lyft.png
        license_plate: AAAAAAA
        make: Audi
        model: A4
    properties:
      beacon_color:
        description: Hex color code of the driver AMP device.
        type: string
      can_cancel:
        items:
          description: The array of actors who may cancel the ride at this point
          enum:
            - driver
            - passenger
            - dispatcher
          type: string
        type: array
      canceled_by:
        description: The role of user who canceled the ride (if applicable)
        type: string
      cancellation_price:
        allOf:
          - $ref: "#/definitions/CancellationCost"
        description: The cost of cancellation if there would be a penalty
        type: object
      destination:
        allOf:
          - $ref: "#/definitions/RideLocation"
        description: The *requested* location for passenger drop off
        type: object
      distance_miles:
        description: The distance, in miles, that this ride traveled. This field is only present after drop-off
        format: float
        type: number
      driver:
        $ref: "#/definitions/DriverDetail"
      dropoff:
        allOf:
          - $ref: "#/definitions/PickupDropoffLocation"
        description: The *actual* location of passenger drop off
        type: object
      duration_seconds:
        description: Duration of the ride in seconds from pickup to drop-off. This field is only present after drop-off.
        format: int32
        type: integer
      feedback:
        description: The written feedback the user left for this ride
        type: string
      generated_at:
        description: The request timestamp in date and time
        format: date-time
        type: string
      line_items:
        description: The break down of cost
        items:
          $ref: "#/definitions/LineItem"
        type: array
      location:
        allOf:
          - $ref: "#/definitions/CurrentRideLocation"
        description: The *current* location info of the ride
        type: object
      origin:
        allOf:
          - $ref: "#/definitions/RideLocation"
        description: The *requested* location for passenger pickup
        type: object
      passenger:
        $ref: "#/definitions/PassengerDetail"
      pickup:
        allOf:
          - $ref: "#/definitions/PickupDropoffLocation"
        description: The *actual* location of passenger pickup
        type: object
      price:
        allOf:
          - $ref: "#/definitions/Cost"
        description: The total price for the current ride
        type: object
      pricing_details_url:
        description: |
          The web view showing the pricing structure for the geographic area where the ride was taken
        type: string
      primetime_percentage:
        description: The Prime Time percentage applied to the base price
        type: string
      rating:
        description: The rating the user left for this ride, from 1 to 5
        format: int32
        type: integer
      requested_at:
        description: The ride requested timestamp in date and time
        format: date-time
        type: string
      ride_id:
        description: The unique ID of this ride
        type: string
      ride_profile:
        allOf:
          - $ref: "#/definitions/RideProfileEnum"
        description: |
          Indicates whether the ride was requested from the business profile or personal profile of the user.
        type: object
      ride_type:
        $ref: "#/definitions/RideTypeEnumWithOther"
      route_url:
        description: |
          The web view showing the passenger, driver, and route for this ride. This field will only be present for rides created through this API, or that have been shared through the "Share my Route" feature
        type: string
      status:
        $ref: "#/definitions/RideStatusEnum"
      vehicle:
        $ref: "#/definitions/VehicleDetail"
    type: object
  RideLocation:
    allOf:
      - $ref: "#/definitions/Location"
      - properties:
          eta_seconds:
            description: Estimated seconds for a driver to pickup or reach destination based on ride status
            format: int32
            type: integer
        type: object
    example:
      address: 123 Main St, Anytown, CA
      eta_seconds: 200
      lat: 36.9442175
      lng: -123.8679133
    type: object
  RideProfileEnum:
    description: The payment profile which the user has picked for the ride
    enum:
      - personal
      - business
    type: string
  RideReceipt:
    description: Receipt information of a processed ride.
    example:
      charges:
        - amount: 500
          currency: USD
          payment_method: Card
        - amount: 405
          currency: USD
          payment_method: Lyft Credit
      line_items:
        - amount: 500
          currency: USD
          type: Ride
        - amount: 250
          currency: USD
          type: Prime Time
        - amount: 155
          currency: USD
          type: Service fee
      price:
        amount: 905
        currency: USD
        description: Total ride price
      requested_at: 2015-09-24T23:26:25+00:00
      ride_id: 123456789
      ride_profile: personal
    properties:
      charges:
        description: The break down of charge method
        items:
          $ref: "#/definitions/Charge"
        type: array
      line_items:
        description: The break down of line items
        items:
          $ref: "#/definitions/LineItem"
        type: array
      price:
        allOf:
          - $ref: "#/definitions/Cost"
        description: The total price for the current ride
        type: object
      requested_at:
        description: The ride requested timestamp in date and time
        format: date-time
        type: string
      ride_id:
        description: The unique ID of this ride
        type: string
      ride_profile:
        allOf:
          - $ref: "#/definitions/RideProfileEnum"
        description: |
          Indicates whether the ride was requested from the business profile or personal profile of the user.
        type: object
    type: object
  RideRequest:
    description: Minimal set of ride details
    example:
      destination:
        address: 123 Main St, Anytown, CA
        lat: 36.9442175
        lng: -123.8679133
      origin:
        address: 123 Main St, Anytown, CA
        lat: 36.9442175
        lng: -123.8679133
      passenger:
        first_name: Jane
        image_url: https://public-api.lyft.com/static/images/user.png
        rating: 4.9
        user_id: "776630198662493392"
      ride_id: 123456789
      status: pending
    properties:
      destination:
        allOf:
          - $ref: "#/definitions/Location"
        description: The *requested* location for passenger drop off
        type: object
      origin:
        allOf:
          - $ref: "#/definitions/Location"
        description: The *requested* location for passenger pickup
        type: object
      passenger:
        $ref: "#/definitions/PassengerDetail"
      ride_id:
        description: The ID of the requested ride
        type: string
      status:
        $ref: "#/definitions/RideStatusEnum"
  RideRequestError:
    description: Details about why a request failed, such as missing or invalid parameters
    properties:
      cost_token:
        description: A token that confirms the user has accepted current Prime Time and/or fixed price charges
        type: string
      error:
        description: A "slug" that serves as the error code (eg. "bad_parameter")
        type: string
      error_description:
        description: A user-friendly description of the error (appropriate to show to an end-user)
        type: string
      error_detail:
        items:
          $ref: "#/definitions/ErrorDetail"
        type: array
      error_uri:
        description: When a user must go through another flow before requesting a ride, this URI specifies which flow to use (e.g. an account challenge flow in a web view)
        type: string
      primetime_confirmation_token:
        description: A token that confirms the user has accepted current Prime Time charges (Deprecated)
        type: string
      primetime_multiplier:
        description: Current Prime Time multiplier (eg. if primetime_percentage is 100%, primetime_multiplier will be 2.0)
        format: float
        type: number
      primetime_percentage:
        description: Current Prime Time percentage
        type: string
      token_duration:
        description: Validity of the token in seconds
        type: string
    required:
      - error
  RideStatusEnum:
    description: The status of the ride
    enum:
      - pending
      - accepted
      - arrived
      - pickedUp
      - droppedOff
      - canceled
      - scheduled
      - unknown
    type: string
  RideType:
    example:
      ride_types:
        - display_name: Lyft Line
          image_url: https://cdn.lyft.com/assets/car_standard.png
          pricing_details:
            base_charge: 200
            cancel_penalty_amount: 500
            cost_minimum: 475
            cost_per_mile: 115
            cost_per_minute: 23
            currency: USD
            trust_and_service: 155
          ride_type: lyft_line
          seats: 2
        - display_name: Lyft
          image_url: https://cdn.lyft.com/assets/car_standard.png
          pricing_details:
            base_charge: 200
            cancel_penalty_amount: 500
            cost_minimum: 500
            cost_per_mile: 115
            cost_per_minute: 23
            currency: USD
            trust_and_service: 155
          ride_type: lyft
          seats: 4
        - display_name: Lyft Plus
          image_url: https://cdn.lyft.com/assets/car_plus.png
          pricing_details:
            base_charge: 300
            cancel_penalty_amount: 500
            cost_minimum: 700
            cost_per_mile: 200
            cost_per_minute: 30
            currency: USD
            trust_and_service: 155
          ride_type: lyft_plus
          seats: 6
    properties:
      display_name:
        description: A human readable description of the ride type
        type: string
      image_url:
        description: The URL of an image representing this ride type
        type: string
      pricing_details:
        $ref: "#/definitions/PricingDetails"
      ride_type:
        $ref: "#/definitions/RideTypeEnum"
      scheduled_pricing_details:
        $ref: "#/definitions/PricingDetails"
      seats:
        description: The maximum number of seats available for rides requested with this ride type
        type: integer
  RideTypeEnum:
    description: The ID of the ride type
    enum:
      - lyft
      - lyft_line
      - lyft_plus
      - lyft_premier
      - lyft_lux
      - lyft_luxsuv
    type: string
  RideTypeEnumWithOther:
    description: The ID of the ride type
    enum:
      - lyft
      - lyft_line
      - lyft_plus
      - lyft_premier
      - lyft_lux
      - lyft_luxsuv
      - other
    type: string
  SandboxDriverAvailability:
    example:
      driver_availability: true
      lat: 37.7833
      lng: -122.4167
    properties:
      driver_availability:
        description: The availability of driver in a region
        type: boolean
      lat:
        description: The latitude component of a location
        format: double
        type: number
      lng:
        description: The longitude component of a location
        format: double
        type: number
    required:
      - lat
      - lng
      - driver_availability
  SandboxPrimetime:
    example:
      lat: 37.7833
      lng: -122.4167
      primetime_percentage: 25%
    properties:
      lat:
        description: The latitude component of a location
        format: double
        type: number
      lng:
        description: The longitude component of a location
        format: double
        type: number
      primetime_percentage:
        description: The Prime Time to be applied as a string, e.g., '25%'
        type: string
    required:
      - lat
      - lng
      - primetime_percentage
  SandboxRideStatus:
    example:
      status: lyft
    properties:
      status:
        $ref: "#/definitions/RideStatusEnum"
    required:
      - status
  SandboxRideType:
    example:
      lat: 37.7833
      lng: -122.4167
      ride_types:
        - lyft
        - lyft_line
        - lyft_plus
    properties:
      lat:
        description: The latitude component of a location
        format: double
        type: number
      lng:
        description: The longitude component of a location
        format: double
        type: number
      ride_types:
        items:
          $ref: "#/definitions/RideTypeEnum"
        type: array
    required:
      - lat
      - lng
      - ride_types
  SandboxRideUpdate:
    description: Response when a sandbox ride is propagated through ride status
    example:
      ride_id: 123456789
      status: accepted
    properties:
      ride_id:
        description: The ID of the ride
        type: string
      status:
        $ref: "#/definitions/RideStatusEnum"
    type: object
  Tip:
    example:
      amount: 300
      currency: USD
    properties:
      amount:
        description: A tip for the driver in cents. To be charged to the user's default charge account.
        format: int32
        minimum: 0
        type: integer
      currency:
        description: The currency in which you want to tip. e.g. USD
        type: string
  TipParams:
    allOf:
      - $ref: "#/definitions/Tip"
    type: object
  UserDetail:
    example:
      first_name: Jane
      image_url: https://public-api.lyft.com/static/images/user.png
      rating: 4.9
    properties:
      first_name:
        description: The passenger's first name
        type: string
      image_url:
        description: The passenger's profile image
        type: string
      rating:
        description: The passenger's rating
        type: string
    required:
      - first_name
      - image_url
      - rating
  VehicleDetail:
    example:
      color: black
      image_url: http://example.com/lyft.png
      license_plate: AAAAAAA
      license_plate_state: CA
      make: Audi
      model: A4
      year: 2016
    properties:
      color:
        description: The vehicle's color
        type: string
      image_url:
        description: The vehicle's image url
        type: string
      license_plate:
        description: The vehicle's license plate
        type: string
      license_plate_state:
        description: The vehicle's license plate state
        type: string
      make:
        description: The vehicle's maker
        type: string
      model:
        description: The vehicle's model
        type: string
      year:
        description: The vehicle's model year
        format: int32
        type: integer
    required:
      - make
      - model
      - year
      - license_plate
      - license_plate_state
      - color
      - image_url
