Sandbox


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’.

State Change APIs

  • ALLOCATE (booking status = CALL_DRIVER):

    Example Request

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

  • CLIENT LOCATE (booking status = CLIENT LOCATED):

    Example Request

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

  • START TRIP (booking status = IN_PROGRESS):

    Example Request

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

  • END TRIP (booking status = COMPLETED):

    Example Request

    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:

  • INVOICE (booking status = INVOICE):

    Example Request

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