Skip to main content

Create a Flight

The flight contains details of a specific flight

Danny Allen avatar
Written by Danny Allen
Updated over a week ago

The flight contains the date, times, departure and arrival locations and the pass template.

You will need the template ID for the template you created earlier


Terminology

Flight

A digital representation of a flight containing essential information like date, times, departure, and arrival locations, and a pass template.

Pass template

A pre-designed layout or structure for a digital pass. It needs a unique template ID to link it to the flight.

Template ID

A unique identifier for a pass template. It's used to reference the specific template to be used for a flight.

Payload

A block of data sent to an API (Application Programming Interface). In this context, it's a JSON object containing all the details for creating a flight.

ISO1801 Format

A standard format used to set times. An example from the text is "2025-10-25T12:00:00".

Postman Collection

A feature within the Postman application that organises and groups API requests. It's used to test and interact with different API endpoints.

Endpoint

A specific URL or location where an API can be accessed. For this article, the endpoint is "PassKit v4 SDK/Flights/Create Flight".


Creating the Flight

Example Payload

{
"carrierCode": "PK",
"flightNumber": "321",
"boardingPoint": "BKK",
"deplaningPoint": "HKG",
"departureDate": {
"year": 2025,
"month": 10,
"day": 25
},
"departureTerminal": "1",
"arrivalTerminal": "1",
"departureGate": "34",
"arrivalGate": "",
"scheduledDepartureTime": {
"dateTime": "2025-10-25T12:00:00"
},
"boardingTime": {
"dateTime": "2025-10-25T11:35:00"
},
"gateClosingTime": {
"dateTime": "2025-10-25T11:50:00"
},
"scheduledArrivalTime": {
"dateTime": "2025-10-25T15:35:00"
},
"passTemplateId": "30orG7hRoGkNwfFBK5NdWe",
"autoInvalidateAfter": 1440,
"autoInvalidateCancelledPasses": true,
"boardingPolicy": "BOARDING_POLICY_UNSPECIFIED",
"seatingPolicy": "SEAT_CLASS_POLICY_UNSPECIFIED",
"status": "SCHEDULED"
}

Edit the Payload

Edit the payload with the relevant information for your Flight.

Times are set using ISO1801 Format

Using the Postman Collection

You can find the Create Flight endpoint with an example in the Postman Collection.

PassKit v4 SDK/Flights/Create Flight

Edit the payload as explained above, and click Invoke to run the request.

Did this answer your question?