Sandbox is our staging environment which provides endpoints to test your application before deploying it to production. The APIs in Sandbox (including query parameters) will be similar to that of production and the responses mock the real-life scenarios.
All requests should be made to:
https://devapi-stg.olacabs-dev.in/mock/
The Sandbox environment has virtual cabs available at the below mentioned locations. You can choose your pickup location at or close to these places.
Once ride is booked, the state of the booking is “ALLOTMENT_PENDING”. You can use the State Change APIs to change the status of the booking to simulate the actual behavior in production. The state changes will be in the below order:
ALLOTMENT_PENDING → CALL_DRIVER → CLIENT_LOCATED → IN_PROGRESS → COMPLETED
For Share category, there will be an extra state between CLIENT_LOCATED and IN_PROGRESS called ‘INVOICE’.
GET
https://devapi-stg.olacabs-dev.in/mock/v1/actions?type=allocate&booking_id=CRN6754321
Headers: {
Authorization: Bearer 96121212f12ff12f12f1f12f1f12f2
x-app-token: f6121212f12ff12f12f1f12f1f12fa
}
{
"status": "SUCCESS",
"message": "Cab allotted successfully!"
}
GET
https://devapi-stg.olacabs-dev.in/mock/v1/actions?type=client_locate&booking_id=CRN6754321
Headers: {
Authorization: Bearer 96121212f12ff12f12f1f12f1f12f2
x-app-token: f6121212f12ff12f12f1f12f1f12fa
}
{
"status": "SUCCESS",
"message": "Client located!"
}
GET
https://devapi-stg.olacabs-dev.in/mock/v1/actions?type=start_trip&booking_id=CRN6754321
Headers: {
Authorization: Bearer 96121212f12ff12f12f1f12f1f12f2
x-app-token: f6121212f12ff12f12f1f12f1f12fa
}
{
"status": "SUCCESS",
"message": "Enjoy the ride!"
}
GET
https://devapi-stg.olacabs-dev.in/mock/v1/actions?type=end_trip&booking_id=CRN6754321&total_bill=200
total_bill - to specify total bill at the end of the ride. If this parameter is absent, bill will be calculated as per rate card.
Headers: {
Authorization: Bearer 96121212f12ff12f12f1f12f1f12f2
x-app-token: f6121212f12ff12f12f1f12f1f12fa
}
{
"status": "SUCCESS",
"message": "Your ride ended!"
}
Additional for Share:
GET
https://devapi-stg.olacabs-dev.in/mock/v1/actions?type=invoice&booking_id=OSN6754713
Headers: {
Authorization: Bearer 96121212f12ff12f12f1f12f1f12f2
x-app-token: f6121212f12ff12f12f1f12f1f12fa
}
{
"status": "SUCCESS",
"message": "INVOICE!"
}