Cab Ride Booking


POST /v1/bookings/create

Solve your users’ local travel needs by letting them book the nearest Ola cab. By providing your user’s location (latitude & longitude) and your partner token (X-APP token), you can enable users to :

  • Login to Ola account.
  • Sign up with Ola in case they’re not registered.

After authentication, your users can :

  • Book the nearest available Ola cab.
  • Get vehicle and driver details on the app and also by sms.
  • Get estimated time of arrival to pickup point (mins).
  • Get share-ride url - users can share this link with friends/family to let them track the ride.
  • Check value of multiplier applied on booking when peak pricing is applicable, e.g. 1.5X.

Your users can book a cab only if they’ve registered with Ola. Users must be logged into their Ola account in order to make a booking.

Note : Advance bookings (RIDE LATER) are now available. Details for Ride Later booking is available here.


Name Data Type Description Type
pickup_lat float The latitude part of the pickup location. Payload
pickup_lng float The longitude of the pickup location. Payload
drop_lat float [Optional] The latitude of the drop location. Payload
drop_lng float [Optional] The longitude of the drop location. Payload
pickup_mode string Valid modes : ["NOW", "LATER"] Payload
category string Car category type, ex: mini
Valid categories: [ micro, mini, sedan, prime, etc ]
Payload
Authorization string OAuth token(OAuth access token must be passed as Authorization header with Bearer token.) Header
X-APP-TOKEN string Key which identifies the partner Header
Content-Type string "application/json" to be passed Header

Example Request

POST

https://devapi.olacabs.com/v1/bookings/create


  "body": {
    "pickup_lat": 12.9490936,
    "pickup_lng": 77.6443056,
    "drop_lat": 12.972934,
    "drop_lng": 77.722302,
    "pickup_mode": "NOW",
    "category": "prime"
  }
      
  "headers": {
    "Authorization": "Bearer baac2cfc6be4489ab044f7d98bff24bf",
    "X-APP-TOKEN": "6a53bcbe222c490196e4b9f87ba9148c",
    "Content-Type": "application/json"
  }

Example Response


{
  "booking_id": "CRN82062573",
  "crn": "82062573"
  "driver_name": "Name of the driver",
  "driver_number": "9999999999",
  "cab_type": "prime",
  "cab_number": "KA 00 AB 007",
  "car_model": "Maruti Swift Dzire",
  "eta": 2,
  "driver_lat": 12.9499098,
  "driver_lng": 77.6418903,
  "share_ride_url": "https://www.olacabs.com/track/85l0atfqs",
  "surcharge_value": "1.5X"
}

Failure Response


Failure response in case pick up and drop are in different cities.


{
  "status": "FAILURE",
  "code": "INVALID_DROP_LOCATION",
  "message": "Please enter a drop location within your city"
} 


Update Drop Location


POST /v1/bookings/drop_location

Update drop location after a booking has been created.


Name Data Type Description Type
drop_lat float The latitude of the drop location. Payload
drop_lng float The longitude of the drop location. Payload
booking_id string Booking ID for the ride Payload
Authorization string OAuth token(OAuth access token must be passed as Authorization header with Bearer token.) Header
X-APP-TOKEN string Key which identifies the partner Header
Content-Type string "application/json" to be passed Header

Example Request

POST

https://devapi.olacabs.com/v1/bookings/drop_location


  "body": {
    "drop_lat": 12.972934,
    "drop_lng": 77.722302,
    "booking_id": "CRN87401325"
  }

  "headers": {
    "Authorization": "Bearer baac2cfc6be4489ab044f7d98bff24bf",
    "X-APP-TOKEN": "6a53bcbe222c490196e4b9f87ba9148c",
    "Content-Type": "application/json"
  }

Example Response


{
  "status": "SUCCESS",
  "request_type": "Update User Booking Drop Location"
  "header": "SUCCESS",
  "text": "Drop Location Updated"
}

Failure Responses


Failure response in case of updating the drop location to a different city.


{
  "status": "FAILURE",
  "request_type": "Update User Booking Drop Location",
  "header": "Invalid Drop Location",
  "text": "Please enter a drop location within your city"
} 

Failure response in case of updating drop location of a completed ride.


{
  "status": "FAILURE",
  "request_type": "Update User Booking Drop Location",
  "header": "Oops!",
  "text": "Sorry, the ride is already completed or cancelled!"
} 


Note

  • The GET method for cab booking has been deprecated and the support will be discontinued in near future.
  • share_ride_url is not available for auto rickshaws.