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"
}
    

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,
    "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
        "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
        }
    ],
    "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"
}