Process Flow
Process Flow
1. Get your Partner Portal credentials from the CabBazar team. You need to
provide Name, Phone and Email for registration on the Partner Portal.
2. Get your Testing server IP whitelisted on the CabBazar Test environment.
3. Login to Partner Portal in the Test environment and get the API key for the Test
environment.
4. Integrate APIs
a. Fetch and store below data in your database. You may refresh / sync it once
in a month through a cron job. The data is different in the Test and
Production environment.
i. Cities for Outstation cab
ii. Cities for Local car rental
iii. Airports for Airport transfer
b. Get prices for Outstation / Local / Airport transfer using respective API. For
Airport transfer, you will need to first retrieve the destination cities list for
the Airport selected by the user.
c. Place booking is a two step process.
Initiate booking API must be called after the user clicks the ‘Payment’
button. If it returns any error, error can be shown to the user otherwise
proceed to the payment gateway for payment of the total amount received
in Initiate booking API response. After the payment is received, call the
Confirm booking API. Initiate booking API will create a booking with
paymentStatus ‘pending’. Only after Confirm booking API, the booking will
be active and the amount will be deducted from your wallet. Confirm
booking API will fail if your wallet balance is low.
d. Create a POST API endpoint (webhook) at your server to receive the
updates on the booking like car & driver details assigned / changed /
removed, booking completed with or without extra kms and final price. It
will be needed to communicate the cab driver details to the customer.
Update the Webhook URL and Webhook key (optional) at Partner Portal.
e. Integrate the Cancel Booking API as needed, to cancel any booking by your
team or the end customer.
f. You can fetch the latest booking details at any time using the Get Booking
details API. Although it should automatically update through the Webhook
provided but you can manually get the latest booking details too at any
point of time using this API.
API Documentation
For Whitelisting your server IP, please contact the CabBazar team.
IMPORTANT – All API communication must be from Server to Server and from
whitelisted IP so that your API key is never exposed. You are responsible for the
security of your API key so that nobody else can make booking by paying
through your wallet. At any time, if you are in doubt, you can generate a new
API key from the partner portal.
Error Response: Success response code is 200. All error response will have error message in
below format:
{“message”: <error message>}
URL: /cities
Method: GET
Parameters:
key=<your API key>
Response:
[
{
"address": "Delhi, Delhi, India",
"placeId": "CABBAZAR_6cbda080-bae4-4bbe-a749-9947ffd2cd46"
}
]
URL: /local/cities
Method: GET
Parameters:
key=<your API key>
Response:
[
{
"cityName": "Agra",
"cityId": "8c058ffa-0419-4aff-b194-e1ef5abaf6ff"
}
]
URL: /airport
Method: GET
Parameters:
key=<your API key>
Response:
[
{
"airportName": "Agra Airport",
"airportId": "4608ac07-0968-4b35-9d65-2bd2f7b84607"
}
]
URL: /fare
Method: POST
Parameters:
{
“key”: <your API key>,
“departureAt”: Trip start datetime in IST (Indian Standard Time) in format
DD/MM/YYYY HH:mm e.g. 05/11/2021 20:30 for November 5, 2021, 8:30 pm.
“isReturn”: true or false. If trip is round trip then true else false.
“arrivalAt”: Trip end date in IST (Indian Standard Time) in format
DD/MM/YYYY e.g. 05/11/2021 for November 5, 2021. This field is only required
for round trip i.e. isReturn – true. Please note its date only and not time.
“itinerary”: [
{“address”: <as received from Get Cities API>,
“placeId”: <as received from Get Cities API>
},
{“address”: <as received from Get Cities API>,
“placeId”: <as received from Get Cities API>
}
]
}
Response:
A sample response is given below.
Important points:
- Possible values for “carType” are 'hatchback', 'sedan', 'innova', 'crysta', 'suv',
'tempo_12', 'tempo_12_ac', 'tempo_15', 'tempo_25'.
- “isFixedRoute”: true means Toll tax / State tax is included in price otherwise
it's extra.
- carrierCharges means charges for Add-on service ‘Assured luggage space
(either carrier or boot space)’ i.e. the add-on service assures that either cab
will have boot space e.g. petrol / diesel cars or it will have carrier e.g. in
CNG cars.
- petCharges means charges for Add-on service ‘Pet Allowed’.
{
"details": {
"isReturn": true,
"itinerary": [
{
"address": "Delhi, Delhi, India",
"placeId": "CABBAZAR_6cbda080-bae4-4bbe-a749-9947ffd2cd46",
"location": {
"lat": 28.7040592,
"lng": 77.10249019999999
}
},
{
"address": "Chandigarh, Chandigarh, India",
"placeId": "CABBAZAR_ecf1e5fb-37de-4a6b-87ff-afee25b713cc",
"location": {
"lat": 30.7333148,
"lng": 76.7794179
}
}
],
"departureAt": "09/02/2022 20:00",
"arrivalAt": "10/02/2022",
"tripDuration": 2,
"isFixedRoute": false,
"taxType": "IGST (5%)",
"terms": [
"Vehicle and fuel charges included",
"Driver Night Charges included",
“For Round trip bookings, all the local sightseeing in the destination cities is
included except for Sikkim and Darjeeling. For local sightseeing in Pickup city (if
required), please add all the Pickup city stops in itinerary.”
"Included Kilometers will start from pickup location",
"Driver allowance includes driver's stay, food and night charges",
"Toll and state tax extra. Customer need to pay directly as per actuals.",
"Parking charges extra if applicable. Customer need to pay directly as per
actuals",
"Extra Kms charge, if any, needs to be paid by Customer directly to the
driver",
"AC will remain switch off in hill areas",
"For round trip booking, Kilometers will count from pickup location to
pickup location",
"One way trip will have only one pickup and one drop. Additional pickup or
drop on the way will incur additional charges of Rs. 250 per pickup / drop.",
"Rohtang Pass needs special permit and is not included in any trip"
],
“cancellationPolicy”: “If driver / car details are not assigned at time of
cancellation then No cancellation charge will be levied on you. If driver / car
details are already assigned at time of cancellation then 20% of booking amount
will be deducted as cancellation charges.”
},
"fareChart": [
{
"carId": "f5d5db79-ea08-4740-8ff0-b8368c6fbe24",
"carType": "sedan",
"includedKm": 500,
"estimatedPrice": 5000,
"estimatedGst": 250,
"extraKmPricePerKm": 9,
“carrierChargesWithoutGst”: 500,
“carrierCharges”: 525,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
525”,
“petChargesWithoutGst”: 800,
“petCharges”: 840,
“petText”: “Pet Allowed for Rs. 840”
},
{
"carId": "ad4fef88-7b04-49fa-9acd-29f1fead3c12",
"carType": "hatchback",
"includedKm": 500,
"estimatedPrice": 5000,
"estimatedGst": 250,
"extraKmPricePerKm": 9,
“carrierChargesWithoutGst”: 500,
“carrierCharges”: 525,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
525”
},
{
"carId": "0788e276-ba8e-42a9-b1cd-0e82fe1fb023",
"carType": "suv",
"includedKm": 500,
"estimatedPrice": 6500,
"estimatedGst": 325,
"extraKmPricePerKm": 12,
“carrierChargesWithoutGst”: 500,
“carrierCharges”: 525,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
525”,
“petChargesWithoutGst”: 800,
“petCharges”: 840,
“petText”: “Pet Allowed for Rs. 840”
},
{
"carId": "b20f14c9-8b7a-4fda-bbd7-bda6b4470a2c",
"carType": "innova",
"includedKm": 500,
"estimatedPrice": 7500,
"estimatedGst": 375,
"extraKmPricePerKm": 14,
“carrierChargesWithoutGst”: 500,
“carrierCharges”: 525,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
525”,
“petChargesWithoutGst”: 1000,
“petCharges”: 1050,
“petText”: “Pet Allowed for Rs. 1050”
},
{
"carId": "3c53a3b7-8bb5-4322-9e19-8e3345f3c26b",
"carType": "tempo_12",
"includedKm": 500,
"estimatedPrice": 12000,
"estimatedGst": 600,
"extraKmPricePerKm": 22.6,
“carrierChargesWithoutGst”: 500,
“carrierCharges”: 525,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
525”,
“petChargesWithoutGst”: 2000,
“petCharges”: 2100,
“petText”: “Pet Allowed for Rs. 2100”
},
{
"carId": "4152f405-c75c-4667-b67d-049de8b4acac",
"carType": "tempo_15",
"includedKm": 500,
"estimatedPrice": 13270,
"estimatedGst": 663.5,
"extraKmPricePerKm": 25.3,
“carrierChargesWithoutGst”: 500,
“carrierCharges”: 525,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
525”,
“petChargesWithoutGst”: 2000,
“petCharges”: 2100,
“petText”: “Pet Allowed for Rs. 2100”
}
]
}
URL: /fare/local
Method: POST
Parameters:
{
“key”: <your API key>,
“departureAt”: Trip start datetime in IST (Indian Standard Time) in format
DD/MM/YYYY HH:mm e.g. 05/11/2021 20:30 for November 5, 2021, 8:30 pm.
“cityId”: <as received from Get Cities for Local car rental API>
“fareType”: “2_20” or “4_40” or “8_80” or “12_120” for 2 hours 20km or 4
hours 40km or 8 hours 80 kms or 12 hours 120 km respectively
}
Response:
A sample response is given below.
Important points:
- Possible values for “carType” are 'hatchback', 'sedan', 'innova', 'crysta', 'suv',
'tempo_12', 'tempo_12_ac', 'tempo_15', 'tempo_25'.
- Possible value for “fareType” are ‘2_20’,‘4_40’, ‘8_80’, ‘12_120’
- carrierCharges means charges for Add-on service ‘Assured luggage space
(either carrier or boot space)’ i.e. the add-on service assures that either cab
will have boot space e.g. petrol / diesel cars or it will have carrier e.g. in
CNG cars.
- petCharges means charges for Add-on service ‘Pet Allowed’.
{
"details": {
"cityId": “8c058ffa-0419-4aff-b194-e1ef5abaf6ff”,
"departureAt": "09/02/2022 20:00",
"fareType": "8_80",
"terms": [
"Vehicle and fuel charges included",
"Driver Night Charges included",
“For Round trip bookings, all the local sightseeing in the destination cities is
included except for Sikkim and Darjeeling. For local sightseeing in Pickup city (if
required), please add all the Pickup city stops in itinerary.”
"Included Kilometers will start from pickup location",
“Kilometers will count from pickup location to pickup location”,
"Driver allowance includes driver's stay, food and night charges",
"Toll and state tax extra. Customer need to pay directly as per actuals.",
"Parking charges extra if applicable. Customer need to pay directly as per
actuals",
"Extra Kms and Extra hours charge, if any, needs to be paid by Customer
directly to the driver",
"AC will remain switch off in hill areas",
"Rohtang Pass needs special permit and is not included in any trip"
],
“cancellationPolicy”: “If driver / car details are not assigned at time of
cancellation then No cancellation charge will be levied on you. If driver / car
details are already assigned at time of cancellation then 20% of booking amount
will be deducted as cancellation charges.”
},
"fareChart": [
{
"carId": "f5d5db79-ea08-4740-8ff0-b8368c6fbe24",
"carType": "sedan",
"estimatedPrice": 5000,
"estimatedGst": 250,
"extraKmPricePerKm": 9,
"extraHourPricePerHr": 200,
“carrierChargesWithoutGst”: 500,
“carrierCharges”: 525,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
525”,
“petChargesWithoutGst”: 800,
“petCharges”: 840,
“petText”: “Pet Allowed for Rs. 840”
},
{
"carId": "0788e276-ba8e-42a9-b1cd-0e82fe1fb023",
"carType": "suv",
"estimatedPrice": 6500,
"estimatedGst": 325,
"extraKmPricePerKm": 12,
"extraHourPricePerHr": 200,
“carrierChargesWithoutGst”: 500,
“carrierCharges”: 525,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
525”,
“petChargesWithoutGst”: 1000,
“petCharges”: 1050,
“petText”: “Pet Allowed for Rs. 1050”
}
]
}
URL: /airport/destination
Method: GET
Parameters:
key=<your API key>
airportId=<as received from Get Airports for Airport transfer API>
fareType=<either “from-airport” or “to-airport”>
Response:
[“Delhi”, “Gurgaon”, “Noida”, “Faridabad”, “Ghaziabad”, “Greater Noida”]
URL: /fare/airport
Method: POST
Parameters:
{
“key”: <your API key>,
“departureAt”: Trip start datetime in IST (Indian Standard Time) in format DD/MM/YYYY
HH:mm e.g. 05/11/2021 20:30 for November 5, 2021, 8:30 pm.
“airportId”: <as received from Get Airport for Airport transfers API>
“destinationCity”: <as received from Get Cities for Airport transfers API>
“fareType”: <either “from-airport” or “to-airport”>
}
Response:
A sample response is given below.
Important points:
- Possible values for “carType” are 'hatchback', 'sedan', 'innova', 'crysta', 'suv',
'tempo_12', 'tempo_12_ac', 'tempo_15', 'tempo_25'.
- Possible value for “fareType” are ‘from-airport’, ‘to-airport’
- “isFixedRoute”: true means Toll tax / State tax is included in price otherwise
it's extra.
- carrierCharges means charges for Add-on service ‘Assured luggage space
(either carrier or boot space)’ i.e. the add-on service assures that either cab
will have boot space e.g. petrol / diesel cars or it will have carrier e.g. in
CNG cars.
- petCharges means charges for Add-on service ‘Pet Allowed’.
{
"details": {
"airportId": “8c058ffa-0419-4aff-b194-e1ef5abaf6ff”,
“destinationCity”: “Delhi”,
"departureAt": "09/02/2022 20:00",
"fareType": "from-airport",
"isFixedRoute": true,
"terms": [
"Vehicle and fuel charges included",
"Driver Night Charges included",
"Toll and state tax included”,
"Parking charges extra if applicable. Customer need to pay directly as per
actuals",
"Included Kilometers will start from pickup location",
"Extra Kms and Extra hours charge, if any, needs to be paid by Customer
directly to the driver",
"AC will remain switch off in hill areas"
],
“cancellationPolicy”: “If driver / car details are not assigned at time of
cancellation then No cancellation charge will be levied on you. If driver / car
details are already assigned at time of cancellation then 20% of booking amount
will be deducted as cancellation charges.”
},
"fareChart": [
{
"carId": "f5d5db79-ea08-4740-8ff0-b8368c6fbe24",
"carType": "sedan",
“includedKm”: 20,
"estimatedPrice": 1000,
"estimatedGst": 50,
"extraKmPricePerKm": 20,
“carrierChargesWithoutGst”: 100,
“carrierCharges”: 105,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
105”,
“petChargesWithoutGst”: 800,
“petCharges”: 840,
“petText”: “Pet Allowed for Rs. 840”
},
{
"carId": "0788e276-ba8e-42a9-b1cd-0e82fe1fb023",
"carType": "suv",
“includedKm”: 20,
"estimatedPrice": 1500,
"estimatedGst": 75,
"extraKmPricePerKm": 25,
“carrierChargesWithoutGst”: 100,
“carrierCharges”: 105,
“carrierText”: “Assured luggage space (either carrier or boot space) for Rs.
105”,
“petChargesWithoutGst”: 1000,
“petCharges”: 1050,
“petText”: “Pet Allowed for Rs. 1050”
}
]
}
8. Initiate Booking
Description: This API creates the cab booking with “paymentStatus” as “pending”.
It must be called after the user clicks on the ‘Payment’ button. It will validate
everything, calculate prices and return the booking object. The total of
“estimatedPrice” + “estimatedGst” should be charged to the customer. API will
throw an error if wallet balance is less than the amount to be deducted.
URL: /booking/initiate
Method: POST
Parameters:
{
“key”: <your API key>,
“tripType”: <either ‘outstation’ or ‘local’ or ‘airport’>,
“departureAt”: Trip start datetime in IST (Indian Standard Time) in format DD/MM/YYYY
HH:mm e.g. 05/11/2021 20:30 for November 5, 2021, 8:30 pm.
“isReturn”: true or false. If trip is round trip then true else false. It should be sent for
Outstation cab booking only i.e. tripType ‘outstation’.
“arrivalAt”: Trip end date in IST (Indian Standard Time) in format DD/MM/YYYY e.g.
05/11/2021 for November 5, 2021. This field is only required for round trip i.e. isReturn – true.
Please note its date only and not time. It should be sent for Outstation cab booking only i.e.
tripType ‘outstation’.
“Itinerary”: <as received from Get Prices for Outstation cab API>. It should be sent for
Outstation cab booking only i.e. tripType ‘outstation’.,
“carId”: <as received from Get Prices API(s)>,
“customerName”: <Name of customer>,
“customerCountryCode”: <STD / ISD country code e.g. ‘91’ for India, ‘1’ for USA. Do not
prepend ‘+’ or ‘0’ before the code>
“customerPhone”: Phone number of customer. Do not add country code to this. Should
be only numeric digits. For India, it must be 10 digit valid phone number,
“customerEmail”: Email id of customer,
“completePickupAddress”: Pickup address (optional field),
“billingName”: Optional billing info if invoice needed in different name.
“gstNumber”: Optional billing info,
“carrierRequired”: true or false. if customer buy “Assured Luggage Space” add-on
service then it is true otherwise false,
“petRequired”: true or false. if customer buy “Pet Allowed” add-on service then it is true
otherwise false.
}
Response:
A sample response is given below.
{
"bookingId": 452,
"user": {
"name": "xxxx",
“countryCode”: “91”,
"phone": "xxxxxxxxxx",
"email": "[email protected]"
},
"travelAgency": { <= will be updated by webhook
"name": "",
"phone": "",
"email": ""
},
"driver": { <= will be updated by webhook
"name": "",
"phone": "",
"email": ""
},
"car": { <= will be updated by webhook
"registrationNumber": "",
"brandName": "",
"carName": ""
},
“tripType”: “outstation”,
“cityId”: “xxxx”,
“fareType”: “8_80”,
“airportId”: “xxxxx”,
“destinationCity”: “Delhi”,
“airportFareType”: “from-airport”,
“completePickupAddress”: “xxxx”,
"carType": "sedan",
"itinerary": [
{
"address": "Delhi, India",
"location": {
"lat": 28.7040592,
"lng": 77.10249019999999
}
},
{
"address": "Chandigarh, India",
"location": {
"lat": 30.7333148,
"lng": 76.7794179
}
}
],
"isReturn": false,
"departureAt": "09/02/2022 20:00",
"arrivalAt": null,
"includedKm": 265,
“isFixedRoute”: true,
"extraKmPricePerKm": 9,
“extraHourPricePerHr”: null,
"estimatedGst": 120,
"estimatedPrice": 2400,
“carrierRequired”: true,
“carrierChargesIncludedInPrice”: 150,
“petRequired”: true,
“petChargesIncludedInPrice”: 800,
"finalGst": 0, <= will be updated by webhook
"finalPrice": 0, <= will be updated by webhook
"taxType": "IGST (5%)",
"extraKm": 0, <= will be updated by webhook
"extraHrs": 0, <= will be updated by webhook
"extraDays": 0, <= will be updated by webhook
“billingInformation”: {“gstNumber”: null, “name”: null},
"status": "booked",
“paymentStatus”: “pending”,
"createdAt": "09/02/2022 13:00",
"cancelledAt": null, <= will be updated by webhook
“completedAt”: null <= will be updated by webhook
}
The booking object fields are explained below:
Field Description
user > countryCode STD / ISD code for customer phone. Only digits. Do
not prepend ‘+’ or zeros.
user > phone Customer phone. Only digits. For India i.e.
countryCode ‘91’, it should be 10 digit number >
6000000000
driver > name Driver name. Driver details will be provided through
Webhook when the cab/driver is assigned to booking.
isReturn true or false. It is true for Round trip and false for One
way trip. It is relevant for Outstation cab booking only
i.e. tripType=outstation.
isFixedRoute true or false. True means Toll tax and State tax are
included in the price. False means it's extra.
extraKmPricePerKm Price for extra kms over and above includedKm. E.g. if
includedKm = 250 and actually the cab runs 270km
then 20km is extra and it will be charged based on
this per km price. Customers need to pay the extra km
charge directly to the driver.
extraHourPricePerHr Price for extra hours for Local car rental. It is relevant
for Local car rental booking only i.e. tripType=local.
estimatedPrice Price for the booking. It includes the price for the
add-on service too, if applicable.
extraDays Field is for internal use and rarely used for invoice
purposes.
9. Confirm Booking
Description: This API confirms the cab booking with “paymentStatus” as “success”.
It must be called after payment is received. It will deduct the payment from the
wallet and confirm the booking. API will throw an error if wallet balance is less
than the amount to be deducted.
URL: /booking/confirm
Method: POST
Parameters:
{
“key”: <your API key>,
“bookingId”: <as received from Initiate Booking API>
}
Response:
{
"bookingId": 452,
"paymentStatus": “success”
}
10. Webhook
Description: Please update Webhook URL in the Partner portal. A POST request,
with booking object JSON in body, will be sent to this Webhook URL whenever car
and driver is assigned / changed / removed for a booking or booking status change
to ‘completed’ and extra km may or may not have been incurred. The webhook
URL should simply send a response “OK”. Partners are advised to mandatorily
provide the Webhook URL because otherwise they will not get the information of
car and driver assigned for booking in real time. Although it can be checked at
Partner portal or can be retrieved through Get booking details API at any point of
time. You can also provide a Webhook Key (optional) on the Partner portal. This
key will be sent in every request to Webhook URL and you can validate it for
security.
URL: /booking/cancel
Method: POST
Parameters:
{
“key”: <your API key>,
“bookingId”: <bookingId>
}
Response:
{
"refund": 2040
}
URL: /lead
Method: POST
Parameters:
{
“key”: <your API key>,
“tripType”: <either ‘outstation’ or ‘local’ or ‘airport’>,
“departureAt”: Trip start datetime in IST (Indian Standard Time) in format DD/MM/YYYY
HH:mm e.g. 05/11/2021 20:30 for November 5, 2021, 8:30 pm.
“isReturn”: true or false. If trip is round trip then true else false. It should be sent for
Outstation cab booking only i.e. tripType ‘outstation’.
“arrivalAt”: Trip end date in IST (Indian Standard Time) in format DD/MM/YYYY e.g.
05/11/2021 for November 5, 2021. This field is only required for round trip i.e. isReturn – true.
Please note its date only and not time. It should be sent for Outstation cab booking only i.e.
tripType ‘outstation’.
“Itinerary”: <as received from Get Prices for Outstation cab API>. It should be sent for
Outstation cab booking only i.e. tripType ‘outstation’.,
“cityId”: <as received from Get Cities for Local car rental API>. It should be sent for Local
car rental booking only i.e. tripType ‘local’.
“airportId”: <as received from Get Airport for Airport transfers API>. It should be sent for
Local car rental booking only i.e. tripType ‘airport’.
“destinationCity”: <as received from Get Cities for Airport transfers API>. It should be
sent for Local car rental booking only i.e. tripType ‘airport’.
“fareType”: <either ‘2_20’,‘4_40’, ‘8_80’ or ‘12_120’ for tripType=’local’. Either
“from-airport” or “to-airport” for tripType=’airport’>
}
Response:
{
“redirectUrl”: “https://cabbazar.com/prices?enquiry=51cb8af0-9d90-44d2-b2f0-3c6ee”
}