Location Information Service

Service which provides information regarding cities

1.1 Cities API
URL : https://erp.pay2all.in/api/user/bus/cities

Method: GET

Description: API to get a list of all the cities along with their city ID.

Output :
Parameter Data Type Description
Id long City ID
Name String City Name
state String State Name
StateId long State Id
latitude double Latitude of city
longitude double Longitude of city

1.2 Aliased city list Api
URL : https://erp.pay2all.in/api/user/bus/aliases

Method: GET


Description: API to get a list of all the aliased cities w.r.t redbus.

Output:
Parameter Data Type Description
Id long City ID
CityName String City Name
aliasNames[] List of Alias Names


Booking Service

This This service enables you to do transactions related to ticket booking.

2.1 Available trips API
URL : https://erp.pay2all.in/api/user/bus/availabletrips?source=2&destination=7&doj=2012-07-16

Method: GET


Description: API to get the list of bus services from the specified source city to the destination city on a specified date.

Input :

Parameter Data Type Mandatory Description Example
Source long Yes City ID of Source City 3 ( City ID for Banglore )
Destination long Yes City Id of Destination City 6 ( City ID for Mumbai)
doj string Yes Travel Date 2020-02-22 ( 22-Feb-2020)


Output : Trip List

If response is success, the output will have the valid data about the bus services.

availableTrips [ ]
Parameter Data Type Description
AC string Possible values are True or False
id       long       Trip Id i.e. unique identifier which will populate the seat layout
details (e.g. 10000005664300609)
arrivalTime long Approx arrival time at the destination.(e.g.:150) See FAQ to convert time into format like 6:30 PM,10:15 AM.
availableSeats long Number of Seats Available.(e.g. : 4)
bookable string Possible values are True or False
avlWindowSeats long Number of Window Seats Available.(e.g. : 1)
boardingTimes[] List of boarding times for this service.
bpDpSeatLayout string Possible values are True or False
busImageCount long Number of bus image.(e.g. : 1)
busTypeId long busType Id (e.g. 1101)
busType string Bus Type (e.g. Volvo A/C,2+1 Sleeper, etc)
busRoutes string Bus Route (e.g.Bangalore-Hyderabad)
cancellationPolicy string This Specifies the Cancellation details and the relevant charges applicable for this trip. (e.g. : 0:12:100:0;12:24:50:0;24:-1:10:0) See FAQ for more details about cancellations.
departureTime long Departure time(e.g. 1260) This is the departure time of main boarding point.
droppingTime[]   List of dropping time at destination.
droppingTimes[] List of dropping time at destination.
dropPointMandatory string To check if dropping point Mandatory or not
fareDetails[] List of fares with complete fare details
fares double List of Fares for particular trip(e.g. 750,550)
operator long Operator id
otgEnabled string Possible values are True or False
partialCancellationAllowed string Possible values are True or False
rtc string Possible values are True or False
seater string Possible values are True or False
maxSeatsPerTicket long Max no. of Seats per Ticket (e.g.6)
zeroCancellationTime long Time of zero Cancellation charges (e.g. 0)
mTicketEnabled string Possible values are True or False
travels string Name of the travels(e.g. KPN travels)
availSrCitizen string Possible values are True or False
availCatCard string Possible values are True or False
idProofRequired string Possible values are True or False
liveTrackingAvailable string Possible values are True or False
nonAC string Possible values are True or False
primaryPaxCancellable string Possible values are True or False
reschedulingPolicy[]
routeId long Route id (e.g.2000000100000062475)
singleLadies string Possible values are True or False
sleeper string Possible values are True or False
vehicleType string BUS


boardingTimes [ ]
Parameter Data Type Description
bpid long Id of the boarding point (e.g. 17977211)
bpName String Name of the boarding point (e.g.Madiwala)
contactNumber long Boarding point contact no.
location String Name of the boarding point location at Source(e.g.Madiwala)
address String Complete address (e.g. Madivala Hosur Rd)
landmark String Landmark details (e.g. In Front Of En Zen Building)
prime String Possible values are True or False
time long Time of boarding at this location.(e.g. 795)




droppingTimes [ ]
Parameter Data Type Description
address string Complete address (e.g. Near Bata showroom )
bpid long Id of the dropping point (e.g. 24878)
bpName string Name of the dropping point (Lakdikapool)
contactNumber long Dropping point contact no.
location string Name of the dropping point location at destination(e.g. abids)
landmark String Landmark details (e.g. Near Bata showroom )
prime String Possible values are True or False
time long Time of the dropping point at this location

fareDetails[ ]
Parameter Data Type Description

bankTrexAmt

double

(e.g. 0) 

baseFare

double

Base Fare  (e.g. 1900.00) 

bookingFee

double

Booking Fee  (e.g. 0) 

childFare

double

(e.g. 0) 

gst

double

GST  (e.g. 95.00) 

levyFare

double

(e.g. 0) 

markupFareAbsolute

double

(e.g. 0) 

markupFarePercentage

double

(e.g. 0) 

opFare

double

(e.g. 0) 

operatorServiceChargeAbsolute

double

(e.g. 0.00) 

 

operatorServiceChargePercentage

double

(e.g. 0.00) 

 

serviceCharge

double

Service Charge (e.g. 0.00) 

serviceTaxAbsolute

double

Service Tax  (e.g. 95.00) 

serviceTaxPercentage

double

(e.g. 0) 

srtFee

double

(e.g. 0) 

tollFee

double

(e.g. 0) 

totalFare

double

1995.00 

List of Error Messages:

  1. Search cannot be performed for past dates
  2. No location found for given id

2.2 TripDetails API (or SeatLayout api)
URL :  https://erp.pay2all.in/api/user/bus/tripdetails?id=100000005664300609

Method: GET

Description: API to get the details of particular trip ID.
The seat layout needs to be generated using the seat array map returned from the API /trip details.
Seat layout: Click here to know more about Seat Layout

Input:

Parameter Data Type Mandatory Description Example
id( Trip ID)      long      Yes Trip Id for selected Trip (use the field "id" from the available trips api call) Trip ID like 100000005664300609


Output :

If response is success, the output will have the valid data about the particular Trip.

tripdetails[ ]

Parameter

Data Type

Description

forcedSeats

string

e.g. C4@ , to check if female or male reserved seat

maxSeatsPerTicket

long

E.g. 6

Seats [ ]

 

Array of seats



 Seats [ ]
Parameter Data Type Description
available string Seat Availability possible values are True or False
column long e.g 3
fare double Fare of the Seat (e.g. 1050)
ladiesSeat string Seats reserved for ladies possible values are True or False
length long Possible Values are 1 or 2
name long Seat No. (e.g. 12)
row long e.g. 1
width long Possible values are 1 or 2
zIndex long Lower Berth(zIndex - 0) and Upper Berth (zIndex - 1)

bankTrexAmt

double

bankTrex amount (e.g. 0) 

baseFare

double

baseFare (e.g.1000.00)

childFare

double

Child Fare (e.g. 0.0) 

concession

double

Concession amount(e.g. 0.0) 

levyFare

double

(e.g. 0.0) 

malesSeat

string

Seats reserved for male possible values are True or False

markupFareAbsolute

double

(e.g. 0.0) 

 

markupFarePercentage

double

(e.g. 0) 

operatorServiceChargeAbsolute

double

(e.g. 0.0) 

 

operatorServiceChargePercent

double

(e.g. 0) 

serviceTaxAbsolute

double

(e.g.50.00) 

 

serviceTaxPercentage

double

(e.g. 5.0000) 

 

srtFee

double

(e.g. 0) 

tollFee

double

(e.g. 0) 



List of Error Messages:

1. Could not fetch trip details for POST DOJ.
2. Could not fetch trip details.
3. Trip is not available anymore.


2.3 Boarding Point details :
URL : https://erp.pay2all.in/api/user/bus/bpdpDetails?id=1000005638305724125

Method: Get


Description: API to give the details of boarding and dropping points such as boarding location,landmark,complete address and contact numbers for the trip.
Note: Please use locationName from getBPDPDetails() response and location from getavailableTrips() response.
Here locationName and name can be the same sometimes but can be different too. name is only for SRP use in your website, whereas locationName is the exact boarding point/ dropping point name. Kindly use locationName for fetching the boarding point/ dropping point in the seat layout page.
2.4 Tripdetails V2 api :
URL : https://erp.pay2all.in/api/user/bus/tripdetailsV2

Method : Post


Description: Please implement BP DP model for GSRTC, OSRTC, JKSRTC, and PEPSU.
We are passing "bpDpSeatLayout": "true" in getAvailableTrips() response. For seat layout, pass bpId and dpId for the trip ids where the bpDpSeatLayout flag is true. This will fetch the correct fare as the fare is updated based on bp and dp.If the bpDpSeatLayout flag is false, pass only inventoryId or else the tripdetails() API will fail. For services where "bpDpSeatLayout" :"True" , partners have to send operator id in the field "operator" in blockTicket request. Operator field mendatory for bp-dp model.

Input:

Parameter Data Type Mandatory Description Example
inventoryId long Yes Trip Id 1000002626701642269
bpId long Yes Boarding point id 17982030
dpId long Yes Dropping point id 17982022


2.5 Block Ticket API
URL :
 https://erp.pay2all.in/api/user/bus/blockTicket

Method : POST


Description: API to tentatively book (block) a ticket. This tentative ticket will be blocked for a specified time and can be confirmed.
This is a post method which takes BlockRequest in request body and returns BlockKey. Once user gives all the above details along with the seat numbers and boarding point, client calls the server to book the seats tentatively. If the specified seats are still available, the server blocks them tentatively and returns a tentative booking reference number(Block key). The seats will be blocked under the given reference number. These seats are blocked for some specified time(8 Min)and this value is returned in the tentative booking confirmation.If there is no confirmation call (next step) from the client before that time, the server will unblock the seats.

Sample JSON:

Click here to View
Input:

Block Request
Parameter Mandatory Data Type Description
availableTripID yes long Available Trip Id Selected (e.g. 100000005744040674)
boardingPointId yes long Id of the Boarding Point(e.g. 3975)
droppingPointId yes long Id of the Dropping Point (e.g. 41532)
destination yes long Id of the Destination(e.g. 3882)
inventoryItems [ ] yes Inventory Item details like fare,passenger deatils etc.
source yes long Id of the Source(e.g. 972)


invetoryItems [ ]
Parameter Mandatory Data Type Description
seatname yes string Valid seat name(e.g. A15)
fare yes double Fare of the seat in Rs(e.g. 1000)
ladiesSeat yes string Seat reserved for ladies(e.g. true or false)
passenger [ ] yes Passenger details like name,email etc.
passengerGSTDetails[ ] no Passenger GST details like gstId,registrationName etc.

passenger [ ] 
Parameter Mandatory Data Type Description
address yes string Address details
age yes long Age
email yes string Email
gender yes string Gender

idNumber

yes

string

ID number

idType

yes

string

Type of ID(e.g. Pancard)

mobile

yes

long

Mobile no

name

yes

string

Name

primary

yes

string

e.g true or false

title

yes

string

like Mr., Ms



passengerGSTDetails[ ]

Parameter

Data Type

Description

registrationName

string

e.g. Ram

gstId

string

e.g. API0234

address

string

e.g. Bangalore

emailId

string

e.g. abcd@gmail.com


Note: If operator have the option of sending GST invoice, customers will get the GST invoice in their email.

Output: blockKey


Parameter Data Type Description
BlockKey String Block Key
           
List of Error Messages:

1.Tentative Booking failed

2.Seats no longer Available

3.Itinerary expired

4.Insufficient Balance

5.Invalid boarding point

6.Trip is not available anymore.

6.please book available ladies seat FIRST

7.Seat reserved for Ladies.


2.6 Get Updated Fare API
URL :
   https://erp.pay2all.in/api/user/bus/rtcfarebreakup?blockKey=31mLBZtYPs

Method : GET


Description:  API to get updated fares.

For few operators (OSRTC, HRTC, UPSRTC, PEPSU, JKSRTC, VRL and GSRTC) there will be fare change after invoking the blockTicket() method. To fetch the updated fares getUpdatedFare() method needs to be invoked by passing the block key each time before invoking the bookTicket() method.
We share "callFareBreakupApi":"true" in getAvailableTrips() response to identify these Bus operators. Do not invoke the Get Updated Fare API method, when the flag is false.
Additional parameters such as Toll fee, Levy charges, etc will be applicable for these RTCs
We are passing these parameters in getUpdatedFare() response. Please find the attached sample getUpdatedFare() responses and ticket templates. Kindly update the same at your end.
Note: Please do not consider TOTAL_FARE from the customerPriceBreakUp. Kindly calculate Total Fare as the sum of Booking fee and other fare components from customerPriceBreakUp(except TOTAL_FARE).
Please find the details below:
a) Both boarding point and dropping point is mandatory for these bookings.
b) Fare will change basis boarding point and dropping point selected for these services.
c) We recommend you to use the attached ticket template for the hard copy of tickets.
d) These RTCs might not honor the booking if the customer produces the ticket print out which is not the same as the one shared with you.
e) PNR and Trip Code are mandatory parameters and are shared in getTicket() API.
Changes in API:
a) Call getAvailableTrips() as usual. You will see these RTC services (if available) with pick up and drop points. Note that the fare that you get on invoking this method is not the actual fare.
b) No changes in getTripDetails() method.
c) Invoke the blockTicket() method with dropping point in addition to other details (like name, contact, boarding point, etc) as the input parameter.
d) Before calling the bookTicket() method, invoke getUpdatedFare() passing the block key as the input parameter. This will give you the fare details of the selected boarding point and dropping point in case of these services. Do not invoke this method for other operators unless mentioned. Please find the attached sample response for the same and consider the fare components in calculating the total fare.
e) Now invoke the bookTicket() method with the same block key as the input parameter.
f) Invoke getTicket() method for ticket details.

VRL Changes:
For VRL (OperatorId: 5483), kindly use getUpdatedFare() API for all VRL services to check the updated fare as there is a discount applicable to single ladies seat booking. VRL might not honor the bookings if the fare is not updated.
As of now, we are passing discounted base fare in the customerPriceBreakUp. Please find the attached sample getUpdatedFare() response for VRL and make the changes accordingly at your end. We are working on passing the full break up. We will let you know once the changes are done to integrate the same at your end.
For cancellation, kindly refer "cancellationHandling" from the response. (Note: This is applicable to all operators wherever we are sharing customerPriceBreakUp.)
-If "cancellationHandling": "CANCELLATION_POLICY", then cancellation charges is applicable as per the cancellation policy.
-If "cancellationHandling": "NOT_REFUNDED", then the component is non-refundable
-If cancellationHandling": "FULLY_REFUNDED, then the component is fully refundable.

Input:

Parameter Data Type Description
BlockKey String Block Key


Output : We get the updated fare.

Parameter Data Type Description
convenienceFee Big decimal By default it is 0
otherCharges Big decimal By default it is 0
previousFare Big decimal Fare before updation
reservationCharges Big decimal By default it is 0
updatedFare Big decimal Updated fare
fareBreakup[] Seat wise fare breakup details
fareBreakup
customerPriceBreakUp[]
seatName long Seat no.
           

2.7 Book Ticket API (or Confirm Ticket)
URL :
  https://erp.pay2all.in/api/user/bus/bookticket?blockKey=29PuE2JriN

Method : POST


Description:  API to confirm the previously tentative booked ticket.
Once the ticket was tentatively booked, client/user collects the ticket fare from the customer and calls the server to confirm the booking. The client needs to give the tentative reference number(Block key) to confirm the ticket. The server will return the confirmed ticket details including Ticket number.


Input:

Parameter Data Type Description
BlockKey String Block Key


Output: TIN

Parameter Data Type Description
TIN String TIN (ticket no.)

If response (response code) is success, the output will return TIN or Ticket No.Eg. 35A8M46R


List of Error Messages:

  1. No blocked itineraries found for the given blockid
  2. Confirm Booking failed
  3. Failed to book ticket.
  4. Ticket Expired

Cancellation Service:

This Service enables you to do transactions related to ticket cancellations.

3.1 Cancellation Data API
URL
 :https://erp.pay2all.in/api/user/bus/cancellationdata?tin=35A8M46R

Method : Get


Description: API to get the Cancellation details of booked ticket.
Returns CancellationData object which contains cancellation charges and refund amount details.Client would make a call to get the details of the ticket to be cancelled.The server would return the amount that can be refunded in case the ticket is cancelable. User then cancels the ticket and issues refund to the customer.

Input:


Parameter Data Type Mandatory Description
tin String Yes Ticket Identification Number.( TIN)

Output:Cancellation Details

If response (response code) is success, the output will have cancellation Details of the ticket.


Cancellationdata[ ]
Parameter Data Type Description
cancellable string Cancellation Status(e.g. true or false)
cancellationCharges [ ]
fares [ ]
partiallyCancellable string Possible values are true or false
serviceCharge double e.g.0
tatkalTime double e.g.49.00


cancellationCharges [ ]
Parameter Data Type Description
key
long Seat Name (Seat no) (e.g. 12)
value double Cancellation Charge ( e.g. 50.0)

fares [ ]
Parameter Data Type Description
key long Seat Name (Seat No) (e.g. 12)
value double Total Fare(e.g. 350.0)

List of Error Messages: 

  1. No Itinerary Found

3.2 Cancel Ticket API
URL :
 https://erp.pay2all.in/api/user/bus/cancelticket

Method : Post


Description:API to cancel a previously booked confirmed ticket.
This is post method which takes CancelRequest in request body Returns CancellationResponse which contains cancellation details. Client would make a call to server to cancel the ticket.

Sample JSON:   


Input:


 cancelRequest
Parameter Data Type Description
tin string Ticket identification number (e.g. 35A8M46R)
seatToCancel string Seat Name to be cancelled(e.g. 16)



Output: CancellationResult

If response (response code) is success, the output will have the valid data about the ticket cancellation transaction.

Parameter Data Type Description
cancellationcharge double Cancellation charge ( e.g. 50)
refundAmount double Amount to be refund(e.g. 700)
tin string Ticket Identification Number( e.g. 35A8M46R)

List of Error Messages:

  1. Partial cancellation not allowed
  2. Itinerary not found
  3. Cancellation failed
  4. Ticket Not Cancellable
  5. Ticket not found
  6. Ticket is already cancelled.

Ticket Information Service :

This service helps to retrieve all transactions like ticket booking and cancellations.


4.1 Print Ticket API (or get Ticket API)
URL :
  https://erp.pay2all.in/api/user/bus/ticket?tin=35A8M46R

Method : Get


Description:
  API to get the details of the booked ticket.

Input:


Parameter Data Type Mandatory Description Example
tin String Yes Ticket Identification Number. 35A8M46R

Output: TicketDetails

If response (response code) is success, the output will have the valid data about the tickets.

Parameter Data Type Description
bookingFee double e.g.0
busType string e.g.A/C Seater/Sleeper
cancellationPolicy string This Specifies the Cancellation details and relevant Charges applicable.
(e.g. cancellationPolicy=0:12:100:0;12:24:50:0;24:-1:10:0)
dateOfIssue string Date of Issue(e.g. 2020-02-27T14:31:01+05:30)
destinationCityId long Destination City Id( 7 for mumbai)
doj string Date of journey( e.g.2020-03-01T00:00:00+05:30)
inventoryId long Inventory Id(e.g.100000005744040674)

dropLocation

string

Dropping point location

dropLocationAddress

string

Dropping location address

dropLocationId

long

Dropping point location id e.g.41532

dropLocationLandmark

string

Dropping point Landmark

dropTime

long

Drop up Time(e.g. 1050)

hasRTCBreakup

string

Possible values are true or false

hasSpecialTemplate

string

Possible values are true or false

inventoryItems[ ]

 

Inventory Item details like fare,Passenger details.

MTicketEnabled

string

Possible values are true or false

partialCancellationAllowed

string

Possible values are true or false

pickUpContactNo

long

Contact no of travels for this pick up location(9999988888)

pickUpLocationAddress

string

Pick up location address(e.g. JNTU,K.P.H.B.)

pickUpLocation

string

Pick up location(e.g. K.P.H.B.)

pickUpLocationId

long

Pick up Location Id(e.g. 39758)

pickUpLocationLandmark

string

Pick up Location landmark(e.g. Near Domlur Flyover)

pickUpTime

long

Pick up Time(e.g. 1260)

pnr

string

pnr details of ticket(RTTPH4T65876732-7680)

primeDepartureTime

long

e.g.710

reschedulingPolicy[]

 

Rescheduling Policy details

serviceCharge

double

Service Charge (e.g.0.00)

sourceCity

string

Source City name (e.g.Bangalore)

sourceCityId

long

City Id of Source(2 for Bangalore)

Status

string

Status of ticket(e.g. Booked)

tin

string

Ticket Identification Number(e.g.35A8M46R)

travels

string

Travel Name ( e.g. National Travels)


 

invetoryItems [ ]
Parameter Data Type Description
fare double Fare of the seat(e.g. 1000)
ladiesSeat string Seat reserved for ladies(Possible values are true or false)
malesSeat string Possible values are true or false
operatorServiceCharge double e.g.0.00
passenger [ ] Passenger details like name,email etc.
seatName long Seat number(e.g.15)
serviceTax double Service tax (e.g. 16.50)

passenger [ ]
Parameter Data Type Description
address string Address details
age long Age
email string Passenger email
gender string Gender
idNumber long ID number
idType string Tyoe of ID(e.g. Pancard)
mobile long Mobile no
name string Passenger Name
primary string e.g true or false
title string like Mr., Ms
singleLadies string e.g true or false
4.2 Check Booked Ticket API
 URL : https://erp.pay2all.in/api/user/bus/checkBookedTicket?blockKey=29PuE2JriN

Method : GET

It returns the ticket object if ticket was confirmed otherwise gives error in standard API format.
To fetch the TIN from the block key this api can be used. In cases where you do not receive a response from our end, kindly use the checkBookedTicket() api to check whether the block key is confirmed or not. If it is confirmed you will get booking details otherwise the error : No confirmed ticket found for the block key.

Parameter Data Type Mandatory Description Example
block key String Yes block key. 29PuE2JriN

Output :Ticket details in case ticket is confirmed else error message



4.3. Bus Cancellation Info API
 URL : https://erp.pay2all.in/api/user/bus/busCancellationInfo?from=2019-05-01&to=2019-05-20

Method : GET

Description : API for fetching Bus Cancelled, BO Cancellation (TINs which are cancelled by operators but not marked as Bus Cancelled) and Alternate Arrangement tins.


Input :


Parameter Data Type Description Example
from String From Date 2019-05-01
to String To Date 2019-05-20

Case1: If from and to query params are not passed in the url then response will return list of all the Bus Cancelled tins till date.
Case2: If from and to query params are passed in the url then response will return only the list of tins for the date mentioned

Output : List of tins


Parameter Data Type Description
tin String Ticket Identification Number.


The refund amount, status and other details can be fetched from getTicket() API. To identify these cancellations, consume cancellationReason in ticket details API.

There will be two types of cancellationReason, in ticket details api.
"cancellationReason": "Bus Cancellation"
"cancellationReason": "BO Cancellation"


For Alternate arrangement tins, we will pass “Alternate Arrangement done by BO” in cancellationMessage field in ticket details API.


Back to top