Note: Apple Certificate is required for issuing both Test and Production boarding pass.
1. Create Image Assets
Image assets represent images displayed on a boarding pass. Required images for boarding pass are:
POST https://api.pub1.passkit.io/images
You can either send a base64 string or a URL to an image on the web.
{
"name": "passkit air",
"imageData": {
"icon": "base_64_or_image_url", // 87 x 87 px
"logo": "base_64_or_image_url", // 660 x 660px
"appleLogo": "base_64_or_image_url", // <=450 x 150px
"appImage": "base_64_or_image_url" // 300 x 200 px
}
}
On a Mac, you can convert image to base64 and copy the contents to the clipboard with the command below:
cat path/to/image.png | base64 | pbcopy
On Windows, you can convert an image to a base64 text file with the following command:
certutil -encode path/to/image.png base64Image.txt
2. Create Template
Template holds images, fields, barcode, and colour settings. You will need image Ids created in Step 1. A sample template payload is available on Postman and in our Documentation.
3. Upload An Apple Certificate
An Apple Certificate is required to issue Apple Wallet boarding passes.
4. Create Departure Airport
Airport information allows you to control how airport names are displayed on the pass.
POST https://api.pub1.passkit.io/flights/airport
{
"iataAirportCode": "HKG",
"icaoAirportCode": "VHHH",
"cityName": "Hong Kong",
"localizedCityName": {
"translations": {
"JA": "香港"
}
},
"airportName": "Hong Kong International Airport",
"localizedAirportName": {
"translations": {
"JA": "香港国際空港"
}
},
"countryCode": "HK",
"timezone": "Asia/Hong_Kong"
}
Airport object is reusable so you do not create one if you have registered a certain airport already.
5. Create Destination Airport
Follow the step 4 to register your destination airport if the destination airport is not created before.
6. Create Carrier
Carrier information is required for each Carrier Code that you wish to issue boarding pass for.
POST https://api.pub1.passkit.io/flights/carrier
{
"iataCarrierCode": "PK",
"icaoCarrierCode": "PKT",
"iataAccountingCode": 0,
"airlineName": "PassKit Air",
"localizedAirlineName": {
"translations": {
"JA": "パスキット航空"
}
},
"passTypeIdentifier": "pass.com.your.certificate.pass.type.id"
}
You will need a certificate id you create at Step 3 for passTypeIdentifier
field.
7. Create Flight Designator
Flight designator holds Flight information. You can also set location (GPS) messages, URL links and beacon messages. Check our Postman sample or Documentation.
8. Issue A Boarding Pass
Boarding pass contains flight and passenger information. Here is a part of payload.
POST https://api.pub1.passkit.io/flights/boardingPass
{
"operatingCarrierPNR": "PK8F8R7",
"ticketNumber": "0411234567890",
"ticketLeg":1,
"boardingPoint": "HKG",
"deplaningPoint": "LHR",
"carrierCode": "PK",
"flightNumber": "1234",
"departureDate": {
"year": 2020,
"month": 12,
"day": 1
},
"passenger": {
"passengerDetails": {
"surname": "James",
"forename": "Jules",
"gender": "MALE"
},
"identityDetails": {
"identityDocument": "PASSPORT",
"issuingCountry": "GB",
"nationality": "British National",
"documentNumber": "5432800398",
"dateOfBirth": {
"year": 1975,
"month": 1,
"day": 8
},
"gender": "MALE",
"issuedDate": {
"year": 2013,
"month": 9,
"day": 3
},
"expiryDate": {
"year": 2023,
"month": 9,
"day": 2
}
},
"withInfant": false
},
"class": "Starter",
"compartmentCode": "Y",
"seatNumber": "32A",
"sequenceNumber": 28,
"freeBaggageAllowance": "0K",
"carryOnAllowance": "7K",
"ssrCodes": [
"WCID"
],
"passengerStatus": "ISSUED_CHECKED_IN",
"additionalDataItems": {
"items": {
"boardingTimeMessage": "Get on board quick or we'll leave without you",
"counterCloseMessage": "Counter closes 45 minutes before departure.",
"counterOpenMessage": "Counter opens 180 minutes before departure.",
"fareType": "Starter",
"gateNotice": "Watch the screens - things change!"
}
}
}
Now you have successfully created your boarding pass!
Need further customisation?
If you have any questions on customising your boarding pass, please free to reach us through Online Chat or contact us at support@passkit.com.