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.
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.
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 }
{
“code” : “VALID_COUPON”
}
{
“code” : “INVALID_COUPON”
}
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.
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 }
[{
"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"
}
}]