India´s Smartest Online BUS Booking Portal

www.etravelsmart.com


Web Service Integration Document

Support e-mail:marketing@etravelsmart.com , apipartners@etravelsmart.com





This document is confidential and may be privileged or otherwise protected from disclosure and may include proprietary information. Unauthorized reproduction or disclosure of this information in whole or in part is prohibited.



  1. Introduction

ETS (eTravelSmart) API is implemented based on RESTful web services. ETS API clients are authenticated using digestive authentication mechanism. ETS API response is identified by initial authentication parameters username/email and password.


  1. Getting started

To start integrating ETS API, you need authentication details (username and password) and API URL for all the supported operations. You need to give the list of IP Addresses being used to access the ETS API. Only these IP address are allowed to access the API.


You can follow the rest of the documentation on how to use different API calls, you can use very simple HTTP GET and POST requests to perform all your operations, it's very simple and straight forward. No SOAP requests/knowledge required.

YK Software solution Pvt Ltd has got strict policy on unwanted load from any of the API users and screen scrapers. To protect from your IP getting black listed, please follow the Best Practices“ for your integration section.


Please contact : marketing@etravelsmart.com, apipartners@etravelsmart.com for more details.


  1. Stations/City Info

This API provides the list of all available stations.


Request Method: HTTP GET

Request URL : http://localhost:8080/etsAPI/api/getStations


The Sample response format of the Stations JSON is:

{

"apiStatus": {

"message": "SUCCESS",

"success": true

},

"stationList": [{

"stationId": -1,

"stationName": "10 dol"

},

{

"stationId": 10086,

"stationName": "10dol"

},

{

"stationId": 13286,

"stationName": "365 head"

},

{

"stationId": 3012,

"stationName": "Achanta"

},

{

"stationId": 2886,

"stationName": "Addanki"

}

}

Response Parameters:


PARAMETER NAME

TYPE

DESCRIPTION

apiStations

Object

List of Stations. It contains the following member variables apiStatus, list of apiStation

apiStation

Object

It contains stationId,stationName

stationId

int

Id of the station

stationName

String

Name of the station

apiStatus

Object

Contains the status and message. It contains following member variables message, isSuccess

Message

String

Contains the message, mostly used when response is failed.

isSuccess

Boolean

True if the response is success else false




  1. AvailableBuses

This API provides the list of available routes between the given source, destination stations and journey-date


Request Method: HTTP GET

Request URL : http://localhost:8080/etsAPI/api/getAvailableBuses?sourceCity=Hyderabad&destinationCity=Bangalore&doj=2014-02-28


Required Details for the Available Buses Information:

PARAMETER NAME

TYPE

REQUIRED

DESCRIPTION

sourceCity

String

Yes

sourceCity Name

destinationCity

String

Yes

Destination city name

doj

String

Yes

Doj, yyyy-MM-dd





The sample response format of the AvailableBuses JSON is:


{
   
"apiAvailableBuses":[
      
{
         
"inventoryType": 1,

         "operatorName": "Uttar Pradesh State Road Transport Corporation(UPSRTC)",

         "departureTime": "10:16 PM",

         "mTicketAllowed": false,

         "idProofRequired": false,

         "serviceId": "1000011400000947912",

         "fare": "1509.00",

         "busType": "Scania A/C Multi Axle Seater (2+2)",

         "routeScheduleId": "1000011422440947912",

         "availableSeats": 42,

         "partialCancellationAllowed": false,

         "arrivalTime": "08:00 AM",

         "cancellationPolicy": "[{\"cutoffTime\":\"0-1\",\"refundInPercentage\":\"75\"},{\"cutoffTime\":\"1-2\",\"refundInPercentage\":\"85\"},{\"cutoffTime\":\"2-24\",\"refundInPercentage\":\"90\"},{\"cutoffTime\":\"24\",\"refundInPercentage\":\"100\"}]",

         "operatorId": 11044,

         "boardingPoints": [{

           "location": "ANAND VIHAR",

           "id": "1360101",

           "time": "10:16 PM"

}],

         "droppingPoints": [{

           "location": "CHARBAGH",

           "id": "1360091",

           "time": "08:00 AM"

}],

         "commPCT": 0.0,

         "isGetLayoutByBPDP": false,

         "isFareUpdateRequired": true,

         "isOpTicketTemplateRequired": false,

         "isOpLogoRequired": false,

         "is_child_concession": true,

         "isRTC": true,


               
}

],
   
"apiStatus":{
      
"message":"SUCCESS",
      
"success":true
   
}

}



Response Parameters:


PARAMETER NAME

TYPE

DESCRIPTION

apiAvailableBuses

Object

Contain APIStatus and list of apiAvailablebuses

apiStatus

Object

Contains the status and message. It contains following member variables message, isSuccess

Message

String

Contains the message, mostly used when response is failed.

isSuccess

Boolean

True if the response is success else false

apiAvailableBus

Object

Contains the following member variables inventoryType, routeScheduleId, serviceId, fare, departureTime, arrivalTime, availableSeats, operatorName, cancellationPolicy, boardingPoints, droppingPoints, busType, partialCancellationAllowed, idProofRequired, operatorId, commPCT, mTicketAllowed

inventoryType

String

Inventory type value.

routeScheduleId

String

Route schedule Id

serviceId

String

Service id or operator route Id

Fare

String

Ticket fare. Coma separated in case of multiple fares.

departureTime

String

Bus departure time (AM/PM format)

arrivalTime

String

Destination arrival time

availableSeats

Int

Available seats in a particular bus

operatorName

String

Name of the Operator

cancellationPolicy

String

List of Cancellation Policy Objects(cutoffTime, refundInPercentage)

cutoffTime

String

Cut off time in hours before journey

refundInPercentage

String

Refund Percentage if cancelled before cutOffTime.

boardingPoints

Object

List of boarding points. Contains id, location, time

Id

String

Boarding point id

Location

String

Location of the boarding point

Time

String

Leaving time from boarding point

droppingPoints

Object

List of dropping points. Contains id, location, time

Id

String

Dropping point id

Location

String

Dropping point location

Time

String

Arrival time of dropping point (AM/PM)

busType

String

Type of bus(Volvo, semi sleeper)

partialCancellationAllowed

Boolean

True or false

idProofRequired

Boolean

True or false

operatorId

Int

Operator Id

commPCT

Double

Offered commission percentage

isMTicketAllowed

Boolean

True/False, Bus can be boarded by showing the SMS if the value is True.

isRTC

Boolean

Given operator is RTC operator If the value is True

isGetLayoutByBPDP

Boolean

If the value is True, Have to pass Boarding & Dropping point in busLayout request to get Updated Fare in busLayout response.

Note:It may applicable for RTC services only.

isOpTicketTemplateRequired

Boolean

Recommend to use the ticket template suggested by Bus Operator (Mostly for RTCs) If the value is True

isOpLogoRequired

Boolean

Recommend to use the Logo of Bus Operator (Mostly for RTCs) in ticket template If the value is True

isFareUpdateRequired

Boolean

Fare changes based on the boarding and dropping point selected if the value if True. Then call getRtcUpdatedFare() after blockTicket() to get Updated Fare If the value is True.

is_child_concession

Boolean

Value True indicates that the child concession is applicable for this bus operator (Mostly RTCs). Rules like less than 11 years is child,Adult should accompany child,etc is defined by bus operator. Decreased fare is returned in getRtcUpdatedFare() method after successful block method.

Note: when primary along with child this will work and here fare is reduced.

NOTE :

1.In getAvailableBuses response you will get inventoryType for every operator. If inventory type 2,4 and 6 then you will get boarding points and dropping points from getBusLayout response, other wise get those from getAvailableBuses response. If dropping point are null please consider arrival city(destination city) as dropping point.

2.While sending source and destination in the availableBuses and busLayout request you should encode and send to etsAPI.

3.For inventoryType:6 in case of MSRTC buses take Boarding Points and Dropping points from busLayout response.


  1. BusLayout


This API provides the bus Seat information.


Request Method: HTTP GET

Request URL :


http://localhost:8080/etsAPI/api/getBusLayout?sourceCity=Hyderabad&destinationCity=Bangalore&doj=2014-03-04&inventoryType=114&routeScheduleId=11553


Required Details for viewing the Seat Information:


PARAMETER NAME

TYPE

REQUIRED

DESCRIPTION

sourceCity

String

Yes

sourceCity Name

destinationCity

String

Yes

Destination city name

Doj

String

Yes

Doj, yyyy-MM-dd

inventoryType

Int

Yes

InventoryType value

routeScheduleId

String

Yes

routeScheduleId value


The sample response format of the BusLayout JSON is:


{
   
"seats":[
      
{
         
"length":1,
         
"id":"D",
         
"width":1,
         
"available": true,
         
"fare":425,
         
"totalFareWithTaxes":456.00,
         
"serviceTaxAmount":25.00,
         
"serviceTaxPer":5.8800,
         
"operatorServiceChargeAbsolute":6.00,
         
" operatorServiceChargePercent":1.4100,
         
"ac":false ,
         
"sleeper":false ,
         
"row":0 ,
         
"column":0 ,
         
"zIndex":0 ,
         
"commission":null ,
         
"ladiesSeat":false,
         
"bookedBy":null
      
},
      
{
         
"length":1,
         
"id":"2",
         
"width":1,
         
"available":true,
         
"fare":425,
         
"totalFareWithTaxes":456.00,
         
"serviceTaxAmount":25.00,
         
"serviceTaxPer":5.8800,
         
"operatorServiceChargeAbsolute":6.00,
         
" operatorServiceChargePercent":1.4100,
         
"ac":false,
         
"sleeper":false,
         
"row":0,
         
"column":1,
         
"zIndex":0,
         
"commission":null,
         
"ladiesSeat":false,
         
"bookedBy":null
      
}

],
   
"boardingPoints":null,
   
"droppingPoints":null,
   
"inventoryType":114,
         
"serviceTaxApplicable":true,
   
"apiStatus":{
      
"message":"SUCCESS",
      
"success":true
   
}
}



Response Parameters:


PARAMETER NAME

TYPE

DESCRIPTION

apiBusLayout

Object

Contains apiStatus,list of boardingPoints, list of seatInfo, serviceTaxApplicable, inventoryType

apiStatus

Object

Contains the status and message. It contains following member variables message, isSuccess

Message

String

Contains the message, mostly used when response is failed.

isSuccess

Boolean

True if the response is success else false

boardingPoints

Object

Contains id, location, time

droppingPoints

Object

Contains id, location, time

Id

String

Boarding point id

Location

String

Location of the boarding point

Time

String

Leaving time from boarding point

seatInfo

Object

Contains id, row, column, zIndex, length, width, fare, totalFareWithTaxes, serviceTaxAmount, serviceTaxPer, commission, available, ladiesSeat, bookedBy, ac, sleeper

Id

String

Seat Id/Name

Row

Int

Row number

Column

Int

Column number

zIndex

Int

Index(0-lower,1-upper)

Length

Int

Length of a seat, possible values are 1 or 2

Width

Int

Width of a seat, possible values are 1 or 2

Fare

BigDecimal

Ticket fare

totalFareWithTaxes

BigDecimal

Ticket fare with service tax amount

serviceTaxAmount

BigDecimal

service Tax Amount

serviceTaxPer

double

serviceTaxAmount in percentages

operatorServiceChargeAbsolute

double

operator serviceTaxAmount

operatorServiceChargePercent

double

operator serviceTaxAmount in percentages

commission

BigDecimal

Commission on this seat if applicable

available

Boolean

Is seat available or not(true/false)

ladiesSeat

Boolean

Is ladies seat or not(true/false) if available

bookedBy

String

Who book the ticket (Male/Female) if not available

Ac

Boolean

Is ac seat or not(true/false)

sleeper

Boolean

Is sleeper seat or not(true/false)

serviceTaxApplicable

boolean

if service tax applicable then it is true otherwise it's false

inventoryType

Int

Inventory type


Bus Layout Example

 Seater/Semi Sleeper


    ZIndex=0, Length=1 and Width=1



Vertical Sleeper


    zIndex=0/1, Length=1 and Width=2 with lower and upper berths

             

Horizontal Sleeper


    zIndex=0, Length=2 and Width=1 with all lower berths



Horizontal Sleeper cum semi sleeper


    zIndex=0/1, Length=1/2 and Width=1 with lower seats/berths and upper berths




  1. BlockTicket


This API is used to block the ticket for a period of 10 minutes.


Request Method: HTTP POST

Request URL : http://localhost:8080/etsAPI/api/blockTicket



Required Passenger Ticket Details:


PARAMETER NAME

TYPE

REQUIRED

DESCRIPTION

APIBlockTicketRequest

Object

Yes

Elements of APIBlockTicketRequest array. It contains the following member variables.

sourceCity, destinationCity, customerEmail,customerName,customerLastName,DOJ, boardingPoint, routeScheduleId, customerPhone, emergencyPhNumber, CustomerAddress, inventoryType, blockSeatPaxDetails

sourceCity

String

Yes

Name of the source city

destinationCity

String

Yes

Name of the destination city

inventoryType

Int

Yes

InventoryType value

routeScheduleId

String

Yes

routeScheduleId value

customerName

String

Yes

Name of the person whobook the ticket

customerLastName

String

Yes

Last Name of the person who book the ticket

customerEmail

String

Yes

Email id of the person who book the ticket

DOJ

String

Yes

Date of Journey in the yyyy//mm/dd format

boardingPoint

Object

Yes

It consists of id, location, time

droppingPoint

Object

Yes

It consists of id, location, time

Id

String

Yes

Boarding point id

location

String

Yes

Boarding point location

Time

String

Yes

Boarding point dispatcher time

customerPhone

String

Yes

Mobile number of the person who book the ticket

emergencyPhNumber

String

Yes

Emergency mobile number

CustomerAddress

String

Yes

Address of the person who book the ticket

blockSeatPaxDetails

Object

Yes

List of BlockSeatPaxDetails member variables. It Consists of age, name, seatNbr, sex, fare, totalFareWithTaxes, ladiesSeat, lastName, mobile, title, email, idType, idNumber, nameOnId, primary, ac, sleeper.

Age

String

Yes

Passenger Age

name

String

Yes

Passenger Name

seatNbr

String

Yes

Passenger Seat Number

Sex

String

Yes

Sex(M/F)

Fare

BigDecimal

Yes

Seat Fare

serviceTaxAmount

BigDecimal

Yes

serviceTaxAmount in Seat Level

operatorServiceChargeAbsolute

  double

Yes

operatorServiceChargeAbsolute in Seat Level

totalFareWithTaxes

BigDecimal

Yes

Seat Fare with service tax amount

ladiesSeat

Boolean

Yes

LadiesSeat(true/false)

lastName

String

Yes

Last name of the Passenger

mobile

String

Yes

Mobile number of the person who travel

Title

String

Yes

Mr/Ms/Mrs

email

String

Yes

Email id of the person who travel

idType

String

Yes

Id Card Type(pan,passport,.....)

idNumber

String

Yes

Id Card Number of given Card

nameOnId

String

Yes

Name on the Id Card

primary

Boolean

Yes

Is primary passenger (true/false)

Ac

Boolean

Yes

Is AC bus(true/false)

sleeper

Boolean

Yes

Is Sleeper(true/false)




The sample request format of the BlockTicket JSON is:


{


"sourceCity": "Hyderabad",


"destinationCity": "Bangalore",


"doj": "2014-04-11",


"routeScheduleId": "6310",


"boardingPoint": {


"id": "6",


"location": "Ameerpet,|Jeans Corner",


"time": "09:00PM"


},



"droppingPoint": {


"id": "4",


"location": "Anand Rao Circle,|Bangalore",


"time": "10:40 PM"


},


"customerName": "test",


"customerLastName": "testing",


"customerEmail": "test@gmail.com",


"customerPhone": "9999999999",


"emergencyPhNumber": "8888888888",


"customerAddress": "kphp",


"blockSeatPaxDetails": [


{


"age": "26",


"name": "test123",


"seatNbr": "R9",


"sex": "M",


"fare": 425,


"serviceTaxAmount": 21.00,


"operatorServiceChargeAbsolute": 30.00,


"totalFareWithTaxes": 476.00,


"ladiesSeat": false,


"lastName": "test456",


"mobile": "7777777777",


"title": "Mr",


"email": "testing@gmail.com",


"idType": "PAN",


"idNumber": "AWk123232",


"nameOnId": "test",


"primary": true,


"ac": false,


"sleeper": false


},


{


"age": "55",


"name": "tes345",


"seatNbr": "L2",


"sex": "F",


"fare": 555,


"serviceTaxAmount": 19.00,


"operatorServiceChargeAbsolute": 25.00,


"totalFareWithTaxes": 599.00,


"ladiesSeat": false,


"lastName": "test456",


"mobile": "7777777777",


"title": "Mrs",


"email": "testing@gmail.com",


"idType": "PAN",


"idNumber": "AWk123232",


"nameOnId": "test",


"primary": false,


"ac": false,


"sleeper": false


}


],


"inventoryType": 0


}


Response Parameters:


MESSAGE

TYPE

DESCRIPTION

APIBlockTicketResponse

Object

Contains apiStatus, inventoryType, blockTicketKey

APIStatus

Object

Contains the status and message

isSuccess

Boolean

True if the response is success else false

message

String

Contains the message, mostly used when response is failed.

inventoryType

Int

Inventory type number

blockTicketKey

String

Key value of the Block ticket



The sample response format of the BlockTicket JSON is:


{
   
"blockTicketKey":"ETS0S2833565",
   
"inventoryType":0,
   
"apiStatus":{
      
"message":"SUCCESS",
      
"success":true
   
}
}

  1. Get RTC Updated Fare


1. This API is used to get the Updated fare for the RTC Services Only.

2. This method is called for the RTC services which we can identify by "isRTC": true parameter in AvailableBuses response.

3. This method is called after the BlockTicket method using the blockTicketKey.

Example services are OSRTC,JKSRTC,MSRTC,UPSRTC,PEPSU(PRTC),etc


Request Method: HTTP GET

Request URL : http://localhost:8080/etsAPI/api/getRtcUpdatedFare?blockTicketKey=blockTicketKey



Request Parameters:


PARAMETER NAME

TYPE

REQUIRED

DESCRIPTION

blockTicketKey

String

Yes

We need to provideblock TicketKey



The sample response format of the getRTCUpdatedFare JSON is:


{
   
"apiStatus": {

"success": "true",

"message": "SUCCESS",

},

"convenienceFee": 30,

"bookingFee": 50,

"reservationFee": 30,

"tollFee": 10,

"otherCharges": 10,

"previousFare": 385,

"updatedFare": 410
}


Response Parameters:


MESSAGE

TYPE

DESCRIPTION

bookingFee

double

Contains booking fee applicable on each seat

reservationFee

double

Contains reservation fee applicable on every booking

convenienceFee

double

Contains convenience fee if it is necessary on that booking

tollFee

double

Contains toll fee if it is necessary on that booking

otherCharges

double

Contains other charges if it is necessary on that booking

previousFare

double

Contains previous Total fare of all passengers before calling getUpdateFare method

updatedFare

double

Updated total fare(Incl charges/taxes if any) for all passengers




  1. Seat Booking


This API is used to book the blocked ticket from BlockTicket API.


Request Method: HTTP GET

Request URL : http://localhost:8080/etsAPI/api/seatBooking?blockTicketKey=”+blockTicketKey


Request Parameters:


PARAMETER NAME

TYPE

REQUIRED

DESCRIPTION

blockTicketKey

String

Yes

We need to provideblockTicketKey



The sample response format of the seatBooking JSON is:


{
   
""opPNR": "ABRS947604",

"etstnumber": "ETS962B0PT82",

"commPCT": 7.2,

"totalFare": 800.0,

"cancellationPolicy": "null",

"tripCode": "15437",

"apiStatus": {

"message": "SUCCESS",

"success": true

},

"inventoryType": 0
}




Response Parameters:


MESSAGE

TYPE

DESCRIPTION

APIBookSeatResp

Object

Contains apiStatus, inventoryType, etstnumber, opPNR, commPCT, totalFare, cancellationPolicy

APIStatus

Object

Contains the status and message

isSuccess

Boolean

True if the response is success else false

message

String

Contains the message, mostly used when response is failed.

inventoryType

Int

Inventory type number

etstnumber

String

ETS Ticket Number

opPNR

String

Operator PNR number

commPCT

Double

Commission

totalFare

Double

Total fare

cancellationPolicy

String

Cancellation Policy

tripCode

String

As of now Tripcode is used in GSRTC ticket booking to show in ticket template.

Note: 1. In case you are not getting row numbers 0,1,2,3..etc, you have to sort row numbers in the form of ascending order then show seat layout with that sorting order.

2. If you get sleeper seats which is having one row in Upper, Lower deck and zIndex=0/1, Length=2 and Width=1 then you have to show as zIndex=0/1, Length=1 and Width=2.

  1. Get Booked Ticket

This method is used to get the booked ticket information by passing the ETS ticket number.

Request Method: HTTP GET

Request URL : http://localhost:8080/etsAPI/api/getTicketByETSTNumber?ETSTNumber=”+ETSTNumber




Request Parameters:


PARAMETER NAME

TYPE

REQUIRED

DESCRIPTION

ETSTNumber

String

Yes

ETS Ticket number generated after successful booking.


Response Parameters:

MESSAGE

TYPE

DESCRIPTION

APIStatus

Object

Contains the message and isSuccess

isSuccess

Boolean

True if the response is success else false

message

String

Contains the message, mostly used when response is failed.

ticketStatus

String

Ticket Status CONFIRMED,CANCELLED,TRAVELLED,

SERVICE_CANCELLED

inventoryType

String

Inventory type value.


String


sourceCity

String

sourceCity Name

destinationCity

String

Destination city name

journeyDate

String

Doj, yyyy-MM-dd

departureTime

String

Bus departure time (AM/PM format)

routeScheduleId

String

Route schedule Id

serviceProvider

String

Name of the Operator

service_type

String

Type of bus(Volvo, semi sleeper)

serviceId

String

Service id or operator route Id

serviceProviderContact

String

Service Provider contact address at boarding point.

boardingPoint

String

Boarding point Name.

droppingPoint

String

Droppoing point

travelerDetails

Object

Passenger details object. It contains Name, lastName, seatNo, Age, Gender and Fare.

name

String

Name of passenger.

lastName

String

Last Name of Passenger.

seatNo

String

Seat number

age

Long

Passenger Age

gender

String

Passenger Gender (M/F)

fare

double

Seat fare.

ETSTNumber

String

ETS Ticket number

opPNR

String

Operator PNR

commPCT

Double

Commission Value

cancellationPolicy

String

Cancellation Policy. Contains cutoffTime and refundInPercentage

bookingDate

Date

Ticket booked date.

cancelDate

Date

Ticket cancelled date if ticket is cancelled

refundAmount

Double

Refund Amount if ticket is cancelled.

tripCode

String

As of now Tripcode is used in GSRTC ticket booking to show in ticket template.


  1. Cancel Ticket Confirmation


This API is used to confirm the cancel ticket details before actually cancelling the ticket.


Request Method: HTTP POST

Request URL : http://localhost:8080/etsAPI/api/cancelTicketConfirmation



Request Parameters:


PARAMETER NAME

TYPE

REQUIRED

DESCRIPTION

APICancelRequest

Object

Yes

Consists of etsTicketNo, List of seatNbrsToCancel

etsTicketNo

String

Yes

We need to provide etsTicketNo

seatNbrsToCancel

List<String>

Yes

List seat numbers to cancel


The sample request format of the cancelTicketConfirmation JSON is:

{

"etsTicketNo":"ETS289B0PT77",

"seatNbrsToCancel":[

"L4",

"L5"

]

}


Response Parameters:


MESSAGE

TYPE

DESCRIPTION

APICancelResp

Object

Contains apiStatus, cancellable, partiallyCancellable, totalTicketFare, totalRefundAmount, cancelChargesPercentage, cancellationCharges

APIStatus

Object

Contains the isSuccess and message

isSuccess

Boolean

True if the response is success else false

Message

String

Contains the message, mostly used when response is failed.

Cancellable

Boolean

Is cancellable(true/false)

partiallyCancellable

Boolean

Is partiallyCancellable

totalTicketFare

String

Total ticket fare

totalRefundAmount

String

Total refund amount

cancelChargesPercentage

String

Cancellation Charges Percentage

cancellationCharges

double

Cancellation Charges in rupees


The sample response format of the cancelTicketConfirmation JSON is:


{
   
"totalTicketFare":"450.00",
   
"totalRefundAmount":"337.5",
   
"cancelChargesPercentage":"25 %",
   
"cancellationCharges":112.5,
   
"apiStatus":{


      
"message":"SUCCESS",
      
"success":true
   
},
   
"cancellable":true,
   
"partiallyCancellable":false
}


  1. Cancel Ticket


This API is used cancel the ticket after confirmation from cancelTicketConfirmation API.


Request Method: HTTP POST

Request URL : http://localhost:8080/etsAPI/api/cancelTicket


Request Parameters:


PARAMETER NAME

TYPE

REQUIRED

DESCRIPTION

APICancelRequest

Object

Yes

Consists of etsTicketNo, List of seatNbrsToCancel

etsTicketNo

String

Yes

We need to provide etsTicketNo

seatNbrsToCancel

List<String>

Yes

List seat numbers to cancel




The sample request format of the cancelTicket JSON is:

{

"etsTicketNo":"ETS289B0PT77",

"seatNbrsToCancel":[

"L4",

"L5"

]

}


Response Parameters:


MESSAGE

TYPE

DESCRIPTION

APICancelResp

Object

Contains apiStatues, cancellable, partiallyCancellable, totalTicketFare, totalRefundAmount, cancelChargesPercentage, cancellationCharges

APIStatus

Object

Contains the isSuccess and message

isSuccess

Boolean

True if the response is success else false

Message

String

Contains the message, mostly used when response is failed.

Cancellable

Boolean

Is cancellable(true/false)

partiallyCancellable

Boolean

Is partiallyCancellable

totalTicketFare

String

Total ticket fare

totalRefundAmount

String

Total refund amount

cancelChargesPercentage

String

Cancellation Charges Percentage

cancellationCharges

double

Cancellation Charges in rupees


The sample response format of the cancelTicket JSON is:


{
   
"totalTicketFare":"450.00",
   
"totalRefundAmount":"337.5",
   
"cancelChargesPercentage":"25 %",
   
"cancellationCharges":112.5,
   
"apiStatus":{
      
"message":"SUCCESS",
      
"success":true
   
},
   
"cancellable":true,
   
"partiallyCancellable":false
}

  1. MyPlan and Current Balance


This API is used to get the plan and balance information of a API partner.


Request Method: HTTP GET

Request URL : http://localhost:8080/etsAPI/api/getMyPlanAndBalance


The sample response format of the getMyPlanAndBalance JSON is:


{
   
"userType":"APIUSER",
   
"planName":"IH9",
   
"rmName":null,
   
"planNature":"HYBRID",
   
"product":"BUS",
   
"allowedIPs":"",
   
"referredBy":null,
   
"rmEmail":null,
   
"domainName":null,
   
"notificationEnabled":false,
   
"inventoryTypes":"-1",
   
"rmContactNumber":null,
   
"registrationDate":1394562600000,
   
"renewalDate":null,
   
"planDescription":"hybrid 9",
   
"fixedCommission":9.0,
   
"dynamicComission":90.0,
   
"serviceCharges":0.0,
   
"registrationAmount":0.0,
   
"apiUserLogin":"test@gmail.com",
   
"balanceAmount":8836.0,
   
"paidRegistrationAmount":false,
   
"lowBalanceAmount":0,
   
"apiStatus":{
      
"message":"SUCCESS",
      
"success":true
   
}
}

Response Parameters:


MESSAGE

TYPE

DESCRIPTION

APIMyPlanAndBalanceResponse

Object

Contains apiStatues, apiUserName, allowedIPs, inventoryTypes, referredBy, rmName, rmEmail, rmContactNumber, lowBalanceAmount, domainName, isNotificationEnabled, isPaidRegistrationAmount, registrationDate, renewalDate, registrationAmount, balanceAmount, planName, product, planNature, userType, planDescription, fixedCommission, dynamicCommission, serviceCharge

APIStatus

Object

Contains the message and isSuccess

isSuccess

Boolean

True if the response is success else false

message

String

Contains the message, mostly used when response is failed.

apiUserName

String

API UserName

allowedIPs

String

IP Addresses allowed to access ETS inventory.

inventoryTypes

String

Inventory type

referredBy

String

Who referred by

rmName

String

Relationship Manager Name

rmEmail

String

Relationship Manager Email

rmContactNumber

String

Relationship Manager ContactNumber

lowBalanceAmount

int

lowBalanceAmount used for email notification.

domainName

String

domainName

isNotificationEnabled

Boolean

isNotificationEnabled

isPaidRegistrationAmount

Boolean

isPaidRegistrationAmount

registrationDate

Timestamp

registrationDate

renewalDate

Timestamp

renewalDate

registrationAmount

Double

registrationAmount

balanceAmount

Double

balanceAmount

planName

String

planName

Product

String

Product

planNature

String

planNature (Dynamic, Fixed and Hybrid)

userType

String

userType

planDescription

String

planDescription

fixedCommission

Double

fixedCommission

dynamicCommission

Double

dynamicCommission

serviceCharge

Double

serviceCharge amount if any


  1. Sample Code

Sample Code


Combined code (for java and php code):

Java Code Php Code

SeatLayout


Sample JavaScript SeatLayout rendering code:

SeatLayoutCode - JS SeatLayoutCode - PHP


  1. FAQ's

  • 1. Is stationId used to get the bus operator data ?

    No,station name only used, you can leave stationId as of now.
    If any changes we will communicate through mail in advance.

  • 2. There are many junk/invalid station names or similar names ?

    Yes, we are aggregating operators across India with different API sources, so we get invalid station names with minor changes (Tirupathi/Tirupati,Amballoor/amballur,etc). We have identified those stations and removed/changed the names and giving you the best/valid station names. Our team is continuously working on this to eliminate these kind of stations. This is a daily automated and manual activity from our system and team to validate and provide best stations to you.

  • 3. What Data To Be Posted If No Dropping Point are not there or null ?

    In some cases operators may not provide the dropping point(s), so in those cases you can show destination city as dropping point in your website or app.In that case while blocking the ticket you need not send dropping point in API request.In any case If you recieve dropping points at that time it is required to send .

  • 4. When do you get Tentative Failed Booking OR Opps Ticket blocking/booking failed ?

    There can be external dependencies like changes at operator's end , then 'TENTATIVE BOOKING FAILED ERROR' may occur.
    a.  Whenever the seat selected is a 'LADIES SEAT' , but the passenger's title is given as 'Mr' or the gender is given as 'MALE' , then 'TENTATIVE BOOKING FAILED ERROR' occurs.
    b.  Whenever the data which partners are accessing is stale , then 'TENTATIVE BOOKING FAILED ERROR' occurs.
    c.  ID proof is mandatory in some cases , but idtype and idnumber is mandatory in all cases , so even if there is no value to be entered the fields must entered in the JSON request.Make sure that the IDtype must be written as PAN_CARD, VOTER_CARD, PASSPORT,DRIVING_LICENCE, RATION_CARD, AADHAR.
    Note:  As we getting only one error message'TENTATIVE BOOKING FAILED ERROR' for all above errors(a,b,c) from operator end . we could not show you proper message for particular errors.

  • 5. What value set for primary for all passengers in blockSeat request ?

    There should be one customer/passenger with primary set as true and all other passengers it should be false.

  • 6. What should be done in case of bus service is cancelled and came to know from customer before eTravelSmart informed ?

    If you get any information about the service cancel,
    kindly do not cancel the ticket and send mail to etravelsmart customer support team customersupport@etravelsmart.com , so that we will check with bus operator and refund the full amount if confirmed.

  •     

TOP