contents
1{
2 "booking_id": "1234-5678-9012",
3 "train_name": "Express",
4 "train_number": "12345",
5 "source": "New York",
6 "destination": "Washington",
7 "departure_time": "2023-03-01T10:00:00-05:00",
8 "arrival_time": "2023-03-01T12:00:00-05:00",
9 "passengers": [
10 {
11 "name": "John Doe",
12 "age": 35,
13 "gender": "male",
14 "seat_number": "A1"
15 },
16 {
17 "name": "Jane Doe",
18 "age": 30,
19 "gender": "female",
20 "seat_number": "A2"
21 }
22 ],
23 "total_fare": 150.00,
24 "status": "confirmed"
25}
26
This JSON represents the response from a real-time train booking API. Let's go through the different parts of the JSON:
The booking_id
field specifies a unique identifier for the booking.
The train_name
field specifies the name of the train.
The train_number
field specifies the train number.
The source
field specifies the name of the source station.
The destination
field specifies the name of the destination station.
The departure_time
field specifies the departure time of the train in ISO 8601 format with timezone offset.
The arrival_time
field specifies the arrival time of the train in ISO 8601 format with timezone offset.
The passengers
field is an array that contains information about the passengers that are part of the booking. Each passenger has a name
, age
, gender
, and seat_number
.
The total_fare
field specifies the total fare for the booking.
The status
field specifies the status of the booking. It can be "confirmed", "cancelled", or "pending" depending on the current state of the booking.
Overall, this JSON provides all the necessary information about a train booking, including the train details, the source and destination stations, the passengers, and the booking status. This response can be used to confirm a booking or to display the booking details to the user.