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.
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 |
GET
http://devapi.olacabs.com/v1/bookings/track_ride?booking_id=CRN123456789
Headers: {
Authorization: Bearer 96121212f12ff12f12f1f12f1f12f2
x-app-token: f6121212f12ff12f12f1f12f1f12fa
}
{
"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"
}
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"
}
{
"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
}
{
"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"
}
{
"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"
}
{
"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"
}
{
"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"
}
{
"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"
}
"otp": {
"start_trip": {
"text": "OTP to start ride",
"value": "2248"
},
"end_trip": {
"text": "OTP to end ride",
"value": "1669"
}
}