Proof of concept - Flight ticket creation

My Tickets


API Endpoint prefix: /api/v1


/ticket Method: [POST]

Parameters:
source Source airport code
destination Destination airport code
departure The datetime string of departure
passport_id

Example return:
{"flight_number": "LX1619", "departure": "2024-11-05 17:35:00", "source": "ARN", "destination": "DUB", "seat": "A26", "passport_id": 12345}


/tickets Method: [GET]

Parameters:
None

Example return:
{"ticket": { "GG8095": { "flight_number": "GG8095", "departure": "2024-11-05 17:35:00", "source": "ARN", "destination": "DUB", "seat": "B06", "passport_id": 12345}}}



/ticket/{flight_number} Method: [GET]

Parameters:
None

Example return:
{"flight_number": "GG8095", "departure": "2024-11-05 17:35:00", "source": "ARN", "destination": "DUB", "seat": "A30", "passport_id": 12345}


/ticket/{flight_number}/seat Method: [POST]

Parameters:
None

Example return:
["Seat updated to B06" ]


/ticket Method: [DELETE]

Parameters:
flight_number

Example return:
["Flight: LX1619 has been deleted."]



Mock data: /mock_airports Method: [GET]

Example return:
A list of 20 airports.