POST Train/Booking
Request Information
URI Parameters
None.
Body Parameters
TrainBookingRequestName | Description | Type | Additional information |
---|---|---|---|
origin | string |
None. |
|
destination | string |
None. |
|
departDate | date |
None. |
|
trainNumber | string |
None. |
|
availabilityClass | string |
None. |
|
subClass | string |
None. |
|
contactName | string |
None. |
|
contactPhone | string |
None. |
|
paxAdult | integer |
None. |
|
paxChild | integer |
None. |
|
paxInfant | integer |
None. |
|
passengers | Collection of TrainPassenger |
None. |
|
trainID | string |
None. |
|
userID |
user API |
string |
None. |
accessToken |
access code getting from login |
string |
None. |
Request Formats
application/json, text/json
Sample:
{ "origin": "sample string 1", "destination": "sample string 2", "departDate": "2025-01-22T11:34:16.2170822+07:00", "trainNumber": "sample string 4", "availabilityClass": "sample string 5", "subClass": "sample string 6", "contactName": "sample string 7", "contactPhone": "sample string 8", "paxAdult": 9, "paxChild": 10, "paxInfant": 11, "passengers": [ { "name": "sample string 1", "birthDate": "2025-01-22T11:34:16.2170822+07:00", "type": 0, "IDNumber": "sample string 3", "phone": "sample string 4", "seatNumber": "sample string 5", "wagonNumber": "sample string 6", "wagonCode": "sample string 7", "DocType": 1 }, { "name": "sample string 1", "birthDate": "2025-01-22T11:34:16.2170822+07:00", "type": 0, "IDNumber": "sample string 3", "phone": "sample string 4", "seatNumber": "sample string 5", "wagonNumber": "sample string 6", "wagonCode": "sample string 7", "DocType": 1 } ], "trainID": "sample string 12", "userID": "sample string 13", "accessToken": "sample string 14" }
application/xml, text/xml
Sample:
<TrainBookingRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Cebes.DI.H2H.Api.Models"> <accessToken>sample string 14</accessToken> <userID>sample string 13</userID> <availabilityClass>sample string 5</availabilityClass> <contactName>sample string 7</contactName> <contactPhone>sample string 8</contactPhone> <departDate>2025-01-22T11:34:16.2170822+07:00</departDate> <destination>sample string 2</destination> <origin>sample string 1</origin> <passengers> <TrainPassenger> <DocType>KTP</DocType> <IDNumber>sample string 3</IDNumber> <birthDate>2025-01-22T11:34:16.2170822+07:00</birthDate> <name>sample string 1</name> <phone>sample string 4</phone> <seatNumber>sample string 5</seatNumber> <type>Adult</type> <wagonCode>sample string 7</wagonCode> <wagonNumber>sample string 6</wagonNumber> </TrainPassenger> <TrainPassenger> <DocType>KTP</DocType> <IDNumber>sample string 3</IDNumber> <birthDate>2025-01-22T11:34:16.2170822+07:00</birthDate> <name>sample string 1</name> <phone>sample string 4</phone> <seatNumber>sample string 5</seatNumber> <type>Adult</type> <wagonCode>sample string 7</wagonCode> <wagonNumber>sample string 6</wagonNumber> </TrainPassenger> </passengers> <paxAdult>9</paxAdult> <paxChild>10</paxChild> <paxInfant>11</paxInfant> <subClass>sample string 6</subClass> <trainID>sample string 12</trainID> <trainNumber>sample string 4</trainNumber> </TrainBookingRequest>
Response Information
Resource Description
TrainBookingResponseName | Description | Type | Additional information |
---|---|---|---|
origin | string |
None. |
|
destination | string |
None. |
|
paxAdult | integer |
None. |
|
paxChild | integer |
None. |
|
paxInfant | integer |
None. |
|
trainNumber | string |
None. |
|
availabilityClass | string |
None. |
|
subClass | string |
None. |
|
bookingCode | string |
None. |
|
bookingDate | date |
None. |
|
issuedTimeLimit | date |
None. |
|
trainName | string |
None. |
|
originFull | string |
None. |
|
destinationFull | string |
None. |
|
departTime | date |
None. |
|
arrivalTime | date |
None. |
|
ticketPrice | decimal number |
None. |
|
salesPrice | decimal number |
None. |
|
adminFee | decimal number |
None. |
|
trainMarkup | decimal number |
None. |
|
discount | decimal number |
None. |
|
passengers | Collection of TrainPassengerModel |
None. |
|
respTime |
describe time in sending response |
date |
None. |
userID |
user ID to access API |
string |
None. |
accessToken |
access token that needed to access API |
string |
None. |
status |
SUCCESS or FAILED |
string |
None. |
respMessage |
detail message of response status |
string |
None. |
Response Formats
application/json, text/json
Sample:
{ "origin": "sample string 1", "destination": "sample string 2", "paxAdult": 3, "paxChild": 4, "paxInfant": 5, "trainNumber": "sample string 6", "availabilityClass": "sample string 7", "subClass": "sample string 8", "bookingCode": "sample string 9", "bookingDate": "2025-01-22T11:34:16.2327189+07:00", "issuedTimeLimit": "2025-01-22T11:34:16.2327189+07:00", "trainName": "sample string 12", "originFull": "sample string 13", "destinationFull": "sample string 14", "departTime": "2025-01-22T11:34:16.2327189+07:00", "arrivalTime": "2025-01-22T11:34:16.2327189+07:00", "ticketPrice": 17.0, "salesPrice": 18.0, "adminFee": 19.0, "trainMarkup": 20.0, "discount": 21.0, "passengers": [ { "name": "sample string 1", "ID": "sample string 2", "birthDate": "2025-01-22T11:34:16.2327189+07:00", "seat": "sample string 4", "wagonNumber": "sample string 5", "wagonCode": "sample string 6", "type": "sample string 7", "phone": "sample string 8", "docType": "sample string 9" }, { "name": "sample string 1", "ID": "sample string 2", "birthDate": "2025-01-22T11:34:16.2327189+07:00", "seat": "sample string 4", "wagonNumber": "sample string 5", "wagonCode": "sample string 6", "type": "sample string 7", "phone": "sample string 8", "docType": "sample string 9" } ], "respTime": "2025-01-22T11:34:16.2327189+07:00", "userID": "sample string 23", "accessToken": "sample string 24", "status": "sample string 25", "respMessage": "sample string 26" }
application/xml, text/xml
Sample:
<TrainBookingResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Cebes.DI.H2H.Api.Models"> <accessToken>sample string 24</accessToken> <respMessage>sample string 26</respMessage> <respTime>2025-01-22T11:34:16.2327189+07:00</respTime> <status>sample string 25</status> <userID>sample string 23</userID> <adminFee>19</adminFee> <arrivalTime>2025-01-22T11:34:16.2327189+07:00</arrivalTime> <availabilityClass>sample string 7</availabilityClass> <bookingCode>sample string 9</bookingCode> <bookingDate>2025-01-22T11:34:16.2327189+07:00</bookingDate> <departTime>2025-01-22T11:34:16.2327189+07:00</departTime> <destination>sample string 2</destination> <destinationFull>sample string 14</destinationFull> <discount>21</discount> <issuedTimeLimit>2025-01-22T11:34:16.2327189+07:00</issuedTimeLimit> <origin>sample string 1</origin> <originFull>sample string 13</originFull> <passengers> <TrainPassengerModel> <ID>sample string 2</ID> <birthDate>2025-01-22T11:34:16.2327189+07:00</birthDate> <docType>sample string 9</docType> <name>sample string 1</name> <phone>sample string 8</phone> <seat>sample string 4</seat> <type>sample string 7</type> <wagonCode>sample string 6</wagonCode> <wagonNumber>sample string 5</wagonNumber> </TrainPassengerModel> <TrainPassengerModel> <ID>sample string 2</ID> <birthDate>2025-01-22T11:34:16.2327189+07:00</birthDate> <docType>sample string 9</docType> <name>sample string 1</name> <phone>sample string 8</phone> <seat>sample string 4</seat> <type>sample string 7</type> <wagonCode>sample string 6</wagonCode> <wagonNumber>sample string 5</wagonNumber> </TrainPassengerModel> </passengers> <paxAdult>3</paxAdult> <paxChild>4</paxChild> <paxInfant>5</paxInfant> <salesPrice>18</salesPrice> <subClass>sample string 8</subClass> <ticketPrice>17</ticketPrice> <trainMarkup>20</trainMarkup> <trainName>sample string 12</trainName> <trainNumber>sample string 6</trainNumber> </TrainBookingResponse>