Coupons


GET /v1/coupons/validate

You can provide your users discounts on their Ola rides booked on your platform via custom coupon codes (Generic coupons applicable on Ola App are not valid on your platform). These custom coupon codes will only be applicable only on your platform and not on the Ola app. Users would need to apply these while booking a ride. You can validate the coupon applied by the user before creation of booking, and ensure it is valid.

Please reach out at affiliates@olacabs.com in case you want to create custom coupon codes. These will be sponsored either by you or Ola as per partnership agreement.

  • To check if the coupon is applicable (Non-Upfront Scenario)

    Mandatory parameters: pickup_lat, pickup_lng, coupon_code, category, X-APP token, authorization The response will just tell if the coupon code is applicable for the user for the chosen category. If yes, it needs to be sent in the booking create call.

    Example Request

    GET

    https://devapi.olacabs.com/v1/coupons/validate?pickup_lat=13.007046&pickup_lng=77.688839&coupon_code=DISC12&category=mini

    Headers: {
    Authorization: Bearer 96121212f12ff12f12f1f12f1f12fe2
    x-app-token: fd5d6121212f12ff12f12f1f12f1f12fa
    }

    Example Response (Success)

    
    {
      “code” : “VALID_COUPON”
    }

    Example Response (Failure)

    
    {
      “code” : “INVALID_COUPON”
    }

  • To check if the coupon is applicable and get the updated fare (Upfront Scenario)

    Mandatory parameters: pickup_lat, pickup_lng, coupon_code, category, X-APP token, Authorization, drop_lat, drop_lng, fare_id* (which was sent in Ride Estimate response)

    *fare_id needs to be HTML encoded, and passed in the query parameters. Eg: ‘1:04:c74a76a2-4516-4564-bc87-eea72089’ → ‘1%3A04%3Ac74a76a2-4516-4564-bc87-eea720894’

    The response will just tell if the coupon code is applicable for the user for the chosen category. If yes, it will also give the updated fare id (incorporating the discount amount). The coupon code along with updated fare_id need to be sent in the booking create call.

    Example Request

    GET

    https://devapi.olacabs.com/v1/coupons/validate?pickup_lat=13.007046&pickup_lng=77.688839&coupon_code=DISC123 &category=mini&fare_id=1%3A04%3A9c25d877-c76e-4de5-a4f5-a6930aab583a&drop_lat=12.9560643&drop_lng=77.65366879

    Headers: {
    Authorization: Bearer 96121212f12ff12f12f1f12f1f12fe2
    x-app-token: f6121212f12ff12f12f1f12f1f12fa
    }

    Example Response (Success)

    
    [{
    	"category": "mini",
    	"distance": 14.36,
    	"travel_time_in_minutes": 50,
    	"amount_min": 533,
    	"amount_max": 561,
    	"discounts":    // Information about the applied coupon
      {
    		"discount_type": "discount",
    		"discount_code": "DISC123",
    		"discount_mode": "MANUAL",
    		"discount ": 50,
    		"cashback": 0
    	},
    	"upfront": {
    		"fare": 561,   			 // Updated discounted price
    		"fare_id": "3:02:25f7dc16-jrjr-4e1b-2343-3c65hfh342", // Updated fare reference id
    		"select_discount": "nil"
    	}
    }]
    

Important Guidelines

  • Make sure the pickup, drop etc are same what was sent in ride estimate call. Also, the fare id needs to be same as what was received in the response of ride estimate call.
  • If the coupon is valid, you will receive an updated fare id which would need to be sent in booking create call for the discounted price to be applicable in the booking
  • The response of this API in case of upfront scenario would be similar to that of ride estimate call. The discount information would be of the manually applied coupon for which this is asked for.