Ride Later booking option allows our customers to book ride for a future date and time. It is available for only selected categories and this varies from city to city. Regarding the availability of the ride later for any category, Ride Availability and Ride Estimate API will contain a field for each category named "ride_later_enabled".
Excerpt from a sample response :
.
..
...
{
"id": "mini",
"display_name": "Mini",
"currency": "INR",
"distance_unit": "kilometre",
"time_unit": "minute",
"eta": 3,
"distance": "0.6",
"ride_later_enabled": "true",
"image": "http://d1foexe15giopy.cloudfront.net/mini.png",
"fare_breakup": [
{
...
..
.
Booking create call is going to be same as for Ride Now bookings, one just needs to provide some additional details while calling.
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 |
pickup_mode | string | "LATER" | Payload |
pickup_time | string | IST time in format as "DD/MM/YYYY HH:MM" | Payload |
category | string | Car category type, ex: mini | 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 |
POST
https://devapi.olacabs.com/v1/bookings/create
"body": {
"pickup_lat": 12.9490936,
"pickup_lng": 77.6443056,
"pickup_mode": "LATER",
"category": "prime",
"pickup_time": "26/07/2016 04:00"
}
"headers": {
"Authorization": "Bearer 6121212f12ff12f12f1f12f1f12f",
"X-APP-TOKEN": "6a536121212f12ff12f12f1f12f1f12f",
"Content-Type": "application/json"
}
{
"status": "SUCCESS",
"booking_id": "CRN123456789",
"message": "You'll receive ride details 15 min before pickup time. Ride cashless by recharging your Ola Money."
}
Failure response if pick up time is not in range
{
"message": "BOOKING_FAILED",
"code": "PICK_TIME_NOT_IN_RANGE"
}
Failure response when user tries to book for unsupported category
{
"message": "BOOKING_FAILED",
"code": "RIDE_LATER_NOT_AVAILABLE_FOR_CATEGORY"
}
Failure in case pick up time is not in expected format
{
"message": "BOOKING_FAILED",
"code": "INVALID_PICK_UP_TIME_FORMAT"
}
Failure in case Ola Booking system refuses to book due to some reason. The message coming here can be displayed to the consumer as it is.
{
"status": "FAILURE",
"code": "BOOKING_RESPONSE_FAILURE",
"message": "Sorry, something went wrong. Please try again later."
}
Apart from these there are other failure responses which are same as for Ride Now bookings.
The track ride API is same as before. A new state is available in the response for scheduled rides.
GET
https://devapi.olacabs.com/v1/bookings/track_ride?booking_id=CRN123456789
{
"status": "SUCCESS",
"request_type": "TRACK_RIDE",
"booking_id": "CRN123456789",
"booking_time": "2016-07-26T19:06:14+5:30",
"pickup_time": "2016-07-27T05:00:00+5:30",
"pickup_lat": 12.9490936,
"pickup_lng": 77.6443056,
"drop_lat": 0,
"drop_lng": 0,
"booking_status": "ALLOTMENT_PENDING"
}
In case no drop_lat or drop_lng is provided at the time of booking, they come as 0.