Cab Ride Tracking


GET /v1/bookings/track_ride

Once a booking is created, user can get to know status of the ride. The API will give different responses based on the state of the booking.

Request Parameters

Name Data Type Description Type Remark
booking_id string Reference ID for the ride sent in booking create response Payload Mandatory
X-APP-TOKEN string Unique key for the partner Header Mandatory
Authorization string Unique key for the user (to be passed as Bearer token) Header Mandatory

Example Request

GET

http://devapi.olacabs.com/v1/bookings/track_ride?booking_id=CRN123456789

Headers: {
  Authorization: Bearer 96121212f12ff12f12f1f12f1f12f2
  x-app-token: f6121212f12ff12f12f1f12f1f12fa
}

Example Response (Success)

ALLOTMENT PENDING (Driver is yet to be allotted)

    

{
 "status": "SUCCESS",
 "request_type": "TRACK_RIDE",
 "booking_id": "CRN123456789",
 "booking_time": "2017-06-09T17:02:31+5:30",
 "pickup_time": "2017-06-09T17:03:01+5:30",
 "pickup_lat": 12.9523,
 "pickup_lng": 77.6432,
 "drop_lat": 12.9592,
 "drop_lng": 77.6974,
 "booking_status": "ALLOTMENT_PENDING"
}
    

SOFT ALLOCATED(Optional)

This booking_status will be available only for specific type of boooking locations(like airport) where a specfic cab won't be alloted instead an OTP will be provided in response and the user need to go the Ola Zone and he/she can onboard any available cab of the booked car category.

    

{
  "status": "SUCCESS",
  "request_type": "TRACK_RIDE",
  "booking_id": "CRN123456789",
  "pickup_lat": 13.198857,
  "pickup_lng": 77.708842,
  "drop_lat": 13.035,
  "drop_lng": 77.632,
  "booking_status": "SOFT_ALLOCATED",
  "otp": {
    "is_soft_allocated": true,
    "start_trip": {
      "text": "OTP to start ride",
      "value": "1234",
      "expiry_time": "1570374294662", // epoch in ms
      "unit": "MINUTES"
    }
  },
  "share_ride_url": "https://www.olacabs.com/track/23kcdfi8v"
}
    

CALL DRIVER (Driver is on the way to pick-up location)

    

{
    "status": "SUCCESS",
    "request_type": "TRACK_RIDE",
    "booking_id": "CRN123456789",
    "driver_name": "Rahul Kumar",
    "driver_number": "9000000000",
    "cab_details": {
        "cab_type": "prime",
        "cab_number": "KA01SJ0009",
        "car_model": "Accord",
        "car_color": "White"
    },
    "driver_image_url": "http://d1foexe15giopy.cloudfront.net/default_driver_image.png",
    "driver_rating": 4.66564,         // avg rating of the driver
    "pickup_lat": 12.8953741,
    "pickup_lng": 77.5859018,
    "drop_lat": 12.9560643,
    "drop_lng": 77.65366879999999,
    "previous_rider_drop_lat" : 12.891231, // drop position of current ride in case of intrip allocation
    "previous_rider_drop_lng" : 77.51231,
    "driver_lat": 12.8967407,          // cab current position
    "driver_lng": 77.5861707,
    "bearing": 0,
    "speed": 0,
    "duration": {           // ETA of cab
        "value": 1,
        "unit": "MINUTES"
    },
    "distance": {
        "value": 647,
        "unit": "METRES"
    },
    "booking_status": "CALL_DRIVER",
    "otp": {
        "start_trip": {
            "text": "OTP to start ride",
            "value": "8709"
        }
    },
    "share_ride_url": "https://olacabs-dev.in/track/23kcdfi8v"  // link to track the ride
}

    

CLIENT LOCATED (Driver reached the pickup location)

     
{
    "status": "SUCCESS",
    "request_type": "TRACK_RIDE",
    "booking_id": "CRN123456789",
    "driver_name": "Rahul Kumar",
    "driver_number": "9000000000",
    "cab_details": {
        "cab_type": "prime",
        "cab_number": "KA01SJ0009",
        "car_model": "Accord",
        "car_color": "White"
    },
    "driver_image_url": "http://d1foexe15giopy.cloudfront.net/default_driver_image.png",
    "driver_rating": 4.66564,
    "pickup_lat": 12.8953741,
    "pickup_lng": 77.5859018,
    "drop_lat": 12.9560643,
    "drop_lng": 77.65366879999999,
    "driver_lat": 12.8967464,
    "driver_lng": 77.5861918,
    "bearing": 0,
    "speed": 1,
    "booking_status": "CLIENT_LOCATED",
    "otp": {
        "start_trip": {
            "text": "OTP to start ride",
            "value": "8709"
        }
    },
    "share_ride_url": "https://olacabs-dev.in/track/23kcdfi8v"
}


    

IN PROGRESS (Ride started and on-going)

    

{
    "status": "SUCCESS",
    "request_type": "TRACK_RIDE",
    "booking_id": "CRN123456789",
    "driver_name": "Rahul Kumar",
    "driver_number": "9000000000",
    "cab_details": {
        "cab_type": "prime",
        "cab_number": "KA01SJ0009",
        "car_model": "Accord",
        "car_color": "White"
    },
    "driver_image_url": "http://d1foexe15giopy.cloudfront.net/default_driver_image.png",
    "driver_rating": 4.66564,
    "pickup_lat": 12.8953741,
    "pickup_lng": 77.5859018,
    "drop_lat": 12.9560643,
    "drop_lng": 77.65366879999999,
    "driver_lat": 12.896758,
    "driver_lng": 77.5862071,
    "bearing": 0,
    "speed": 0,
    "booking_status": "IN_PROGRESS",
    "share_ride_url": "https://olacabs-dev.in/track/23kcdfi8v"
}

    

COMPLETED (Ride ended and bill generated)

    

{
    "status": "SUCCESS",
    "request_type": "TRACK_RIDE",
    "booking_id": "CRN123456789",
    "pickup_lat": 12.8953741,
    "pickup_lng": 77.5859018,
    "drop_lat": 12.9560643,
    "drop_lng": 77.65366879999999,
    "trip_info": {
        "amount": 135,                // Total Recoverable Amount (Ride Fare + Cancellation Fees)
        "payable_amount": 0,     // Amount to be paid in cash
        "distance": {
            "value": 0,
            "unit": "KMS"
        },
        "trip_time": {
            "value": 3,
            "unit": "MINUTE"
        },
        "wait_time": {
            "value": 3,
            "unit": "MINUTE"
        },
        "discount": 0,              // Any discount due to coupon if applicable
        "pass_savings": 16,
        "advance": 135,             // Amount attributed to cashless instrument
        "mode_of_advance": "ola_money"        // Cashless instrument
    },
    "fare_breakup": [
        {
            "display_text": "Ride Fare",
            "value": 96
        },
        {
            "display_text": "Advance Booking Fee",
            "value": 25
        },
        {
            "display_text": "Taxes",
            "value": 14.3
        },
        {
            "display_text": "Rounded Off",
            "value": 0.3
        },
        {
            "display_text": "Total Bill",     // Ride Fare
            "value": 135
        },
        {
            "display_text": "Cancellation Fee",  // Previous Ride Cancellation Charges
            "value": 0
        }
    ],
    "payment_details": [
        {
            "display_text": "Cash",
            "value": 626
        }
    ],
    "cab_details": {
        "cab_type": "prime",
        "cab_number": "KA01SJ0009",
        "car_model": "Accord",
        "car_color": "White"
    },
    "booking_status": "COMPLETED"
}

    

CANCELLED (Ride cancelled)

    

{
    "status": "SUCCESS",
    "request_type": "TRACK_RIDE",
    "booking_id": "CRN123456789",
    "pickup_lat": 12.8953741,
    "pickup_lng": 77.5859018,
    "drop_lat": 12.9560643,
    "drop_lng": 77.65366879999999,
    "cab_details": {
        "cab_type": "prime",
        "cab_number": "KA01SJ0009",
        "car_model": "Accord",
        "car_color": "White"
    },
    "booking_status": "BOOKING_CANCELLED"
}
    

ALLOTMENT FAILED (Driver could not be allotted to the booking)

    

{
    "status": "SUCCESS",
    "request_type": "TRACK_RIDE",
    "booking_id": "CRN123456789",
    "pickup_lat": 13.0107881,
    "pickup_lng": 77.5527122,
    "drop_lat": 12.9560643,
    "drop_lng": 77.65366879999999,
    "booking_status": "ALLOTMENT_FAILED"
}

    

Notes:

  • Outstation Ride: For outstation rides, otp will be visible in the following format for CLIENT_LOCATED, CALL_DRIVER, IN_PROGRESS status.
     "otp": {
       "start_trip": {
           "text": "OTP to start ride",
           "value": "2248"
       },
       "end_trip": {
           "text": "OTP to end ride",
           "value": "1669"
       }
     }
  • Ride Status Consistency: It is for handling corner case and a recommendation for rides which are not in terminal state in your system(database) due to any reason(If the webhook status update API is missed or you didn't call track_ride API for a booking). Please schedule a daily job for bookings which are not closed by calling our track_ride API. This will ensure that your system will be latest booking status. Also, if required you can take any action depending on the booking_status.