POST
/v1/bookings/cancel
Rides booked on your platform can be cancelled before the ride is started. A valid cancellation reason needs to be sent in the request, which needs to be chosen by the user out of given options.
Name | Data Type | Description | Type | Remark |
---|---|---|---|---|
booking_id | string | Reference ID for the ride sent in booking create response | Payload | Mandatory |
reason | string | Reason selected by user | Payload | Mandatory |
Authorization | string | Authorization Token identifies the user | Header | Mandatory |
X-APP-TOKEN | string | Key which identifies the partner | Header | Mandatory |
POST
https://devapi.olacabs.com/v1/bookings/cancel
{
"booking_id":"CRN0000000",
"reason":"My reason is not listed"
}
Headers: {
Authorization: Bearer 9b16121212f12ff12f12f1f12f1f12f2
x-app-token: fd5d46121212f12ff12f12f1f12f1f12f3a
}
{
"status": "SUCCESS",
"request_type": "BOOKING_CANCEL",
"header": "Success",
"Text": "Your booking with CRN 0000000 has been cancelled successfully"
}
{
"reason": "BOOKING_ALREADY_CANCELLED",
"header": "Uh-oh!",
"text": "Your booking has been already cancelled.",
"request_type": "BOOKING_CANCEL",
"status": "FAILURE"
}
{
"reason": "RIDE_IN_PROGRESS",
"header": "Uh-oh!",
"text": "You cannot cancel ongoing ride.",
"request_type": "BOOKING_CANCEL",
"status": "FAILURE"
}
{
"reason": "BOOKING_ALREADY_COMPLETED",
"header": "Uh-oh!",
"text": "Your booking has been completed already.",
"request_type": "BOOKING_CANCEL",
"status": "FAILURE"
}
GET
method for ride cancellation has been deprecated and the support will be discontinued in near future.
GET
/v1/bookings/cancel/reasons
A user needs to submit a reason for cancelling a ride.
This API will give a list of all acceptable reasons for different categories based on the city (pickup_lat, pickup_lng).
So it's possible to get different reasons for the same category with different pickup location.
Note : For rental category the cancel reasons will be based on the sub_category. So if a user rents a mini then the valid cancel reasons will be that of mini based on the pickup location.
Name | Data Type | Description | Type |
---|---|---|---|
category | string | ex: mini (valid are micro/mini/sedan/prime/lux/suv/share/rental) | Payload |
pickup_lat | float | The latitude part of the pickup location. | Payload |
pickup_lng | float | The longitude part of the pickup location. | Payload |
Authorization | string | Authorization Token identifies the user | Header |
X-APP-TOKEN | string | Key which identifies the partner | Header |
GET
https://devapi.olacabs.com/v1/bookings/cancel/reasons?category=mini&pickup_lat=12.9491416&pickup_lng=77.64298
"headers": {
"Authorization": "Bearer 6121212f12ff12f12f1f12f1f12ff",
"X-APP-TOKEN": "6a6121212f12ff12f12f1f12f1f12f8c"
}
{
"cancel_reasons": {
"mini": [
"Expected a shorter wait time",
"Unable to contact driver",
"Driver denied duty",
"Cab is not moving in my direction",
"My reason is not listed"
]
},
"cancellation_policies": {
"mini": {
"cancellation_charge": 50,
"currency": "INR",
"cancellation_charge_applies_after_time": 0,
"time_unit": "minute"
}
}
}