This guide outlines specific ways that you can use the Google Pay API for Passes to engage with your customers for boarding passes for the flights vertical. The API allows you to offer your customers the following options:
- Update boarding passes.
- Save a flight journey with multiple legs.
- Group multiple boarding passes.
- Handle expired passes.
- Receive upcoming flight notifications.
- Receive flight update notifications.
- Link to a saved pass.
Update boarding passes
If there are changes to a boarding pass after it's saved, you can use the
PATCH REST API to deliver those changes to passengers.
To update the fields for all of the boarding passes for a specific flight, such as when the
estimated departure time changes, you only need to
FlightClass. Google propagates this information to the saved
FlightObject in the Google Pay app, which is then associated to the updated
To update a single boarding pass, such as when a seat number for one passenger changes, you need
PATCH a single
FlightObject. Google propagates this information to the
for that passenger, which is saved in the Google Pay app.
Sometimes, you might not know when a change happens, or when to trigger an
PATCH REST API call. In that case, periodically schedule
PATCH REST API calls for each and for every
FlightClass, as well as each
Data sources for flight updates
If the time given by
class.localScheduledDepartureDateTime was in the past 24 hours
or is in the next 48 hours, a flight status card appears to users. When this happens, Google Pay
can display data from either Google Flights
or the information given in the Google Pay pass. Which source is used depends on the
class.localEstimatedOrActualDepartureDateTimeis not provided, then Google Flights is used. In this case, any
class.flightStatusyou set is ignored.
For instance, if a flight is delayed, users see a card under the "Home" tab of the Google Pay app that displays the new departure time. A similar delay card also surfaces to users under the "Passes" tab.
- If you've provided the
class.flightStatus, the provided time is used to determine if a flight is delayed. The flight status on the card is then surfaced to users based on the following logic:
class.localEstimatedOrActualDepartureDateTimeis greater than
class.localScheduledDepartureDateTime, show users a card with the flight listed as delayed.
class.localEstimatedOrActualDepartureDateTimeis not greater than
class.localScheduledDepartureDateTime, show users the card with the flight information but without any status message.
If you don't want to use Google Flights as a source of information about flights, be sure to
localEstimatedOrActualDepartureDateTime of a
FlightClass. Only your data
is used on the card. Alternatively, if you use an ICAO carrier code instead of an IATA code in
FlightClass, Google Flights is not used as a source of flight information.
When certain fields are changed, the user receives push notifications about the changes. For more details, see Receive flight update notifications.
Save a flight journey with multiple legs
Often, one flight journey includes multiple legs rather than a direct journey to a person's
destination. During this journey, airlines issue one boarding pass per leg of the journey. The
Google Pay API for Passes mimics this behavior, with one
FlightObject per leg.
This means if you have two passengers who fly from SFO to LAX to TPE, there would be two
FlightClass structures and four
These fields reflect the physical boarding passes. Both Passenger Q and Passenger Z would have two paper boarding passes.
Make a button to save multiple passes
If a user buys multiple passes, and they're likely to save all of them to Google Pay, then it's useful to allow a user to save many objects with one click of a Save to Google Pay button or link. Multiple objects or classes can be defined in the JSON Web Token (JWT) to be signed.
The JWT must be made in either of the following formats:
- Only pre-inserted classes and objects are used.
- Only object and class resources that are fully defined within the JWT are used.
Group multiple boarding passes
There are features which work differently if they're used on a group rather than individual objects, such as status notifications or organization of multiple Passes saved for many passengers on the user interface.
FlightObject objects are only considered to be a group if all of the following properties
are the same for each object:
- Issuer ID (from Google Pay API for Passes Merchant Center)
FlightObject objects differ on any of the above properties, they are not considered
to be grouped.
Handle expired passes
Under the "Passes" tab of the Google Pay app, there's an "Expired passes" section that contains all archived or inactive passes. A boarding pass is moved to the "Expired passes" section if at least one of the following conditions is true:
- 24 hours have passed since the
class.localEstimatedOrActualDepartureDateTimeof the boarding pass.
object.validTimeInterval.end.dateof the boarding pass has passed. The pass may move to "Expired passes" anytime up to 24 hours after
FlightObjectis marked as
Receive upcoming flight notifications
Google Pay sends a notification to the user three hours prior to their flight departure time.
The flight departure time is established by
To receive this notification, the user must enable notifications. To do so, they need to navigate to Settings > Notifications and turn on Updates about your passes.
The notification appears in two places, the lock screen and the notifications area.
If the user has notifications enabled for the lock screen, they receive the status notification in the following unmodifiable format:
Boarding pass for your flight to class.destination.airportIataCode Expand for more options
If they tap the notification and unlock their device, their pass appears in the Google Pay app.
If the user has multiple passes, only the soonest useable pass is shown. If they've saved many boarding passes for the same flight leg as per Group multiple boarding passes, the notification only shows one of the passes in the group. However, when they tap it, the user can swipe left and right to see the other passes in that group.
Status notifications won't auto-dismiss after a user opens them. Auto-dismiss occurs 60 minutes after the scheduled departure time.
The notification shows the barcode and other options. The user can tap it to view the pass in the Google Pay app.
The notification is pinned to the notification area. It won't auto-dismiss after a user opens it. Auto-dismiss occurs 60 minutes after the scheduled departure time.
Receive flight update notifications
When certain fields of a flight are changed, users with one or more boarding passes saved receive a push notification on their devices. This happens only if certain conditions are met.
Origin terminal and gate
If you change
and the following condition is met, a notification is sent that the field has changed.
- There are less than three hours to go
The notification is in the following format: “Sample Airlines has updated your gate to A1.” The format cannot be changed.
Boarding time and departure time
If you change
class.localEstimatedOrActualDepartureDateTime, and conditions below are met, a
notification is sent that the field has changed.
- There are less than 24 hours to go
- The respective time changes by at least 10 minutes or more.
The notification is in the following format: "Sample Airlines has updated your boarding time to 6:00PM." The format cannot be changed.
Link to a saved pass
Once a user has a pass saved, reference its
objectId in order to link to the
Use the following link to reference the pass:
The pass can be viewed with the Google Pay app or a web browser.