Use cases

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

If there are changes to a boarding pass after it's saved, you can use the UPDATE or 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 UPDATE or PATCH the FlightClass. Google propagates this information to the saved FlightObject in the Google Pay app, which is then associated to the updated FlightClass.

To update a single boarding pass, such as when a seat number for one passenger changes, you need to UPDATE or PATCH a single FlightObject. Google propagates this information to the FlightObject 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 UPDATE or PATCH REST API call. In that case, periodically schedule UPDATE or PATCH REST API calls for each and for every FlightClass, as well as each and every FlightObject.

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 following:

  • If class.localEstimatedOrActualDepartureDateTime is not provided, then Google Flights is used. In this case, any class.flightStatus you 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.localEstimatedOrActualDepartureDateTime but not 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:
    • If class.localEstimatedOrActualDepartureDateTime is greater than class.localScheduledDepartureDateTime, show users a card with the flight listed as delayed.
    • If class.localEstimatedOrActualDepartureDateTime is 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 provide the flightStatus, localScheduledDepartureDateTime, and 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 FlightObject objects:

  FlightClass A (SFO to LAX: Carrier, flight number, departure time) FlightClass B (LAX to TPE: Carrier, flight number, departure time)
Passenger Q FlightObject: id_01 FlightObject: id_02
Passenger Z FlightObject: id_03 FlightObject: id_04

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.

For an example of how to create a button for multiple passes, see Save multiple passengers button. For more information on the UI representation of Passes, see Group multiple boarding passes.

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)
  • class.flightHeader.carrier.carrierIataCode
  • class.flightHeader.flightNumber
  • class.localScheduledDepartureDateTime
  • object.reservationInfo.confirmationCode

If two 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.localScheduledDepartureDateTime or class.localEstimatedOrActualDepartureDateTime of the boarding pass.
  • The object.validTimeInterval.end.date of the boarding pass has passed. The pass may move to "Expired passes" anytime up to 24 hours after object.validTimeInterval.end.date.
  • The state field of FlightObject is marked as Expired, Inactive, or Completed.

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 class.localScheduledDepartureDateTime.

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.

Lock screen

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.

Notifications area

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 class.origin.terminal or class.origin.gate, and the following condition is met, a notification is sent that the field has changed.

  • There are less than three hours to go before class.localScheduledDepartureDateTime.

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.localBoardingDateTime or class.localEstimatedOrActualDepartureDateTime, and conditions below are met, a notification is sent that the field has changed.

  • There are less than 24 hours to go before class.localScheduledDepartureDateTime.
  • 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.

Once a user has a pass saved, reference its objectId in order to link to the pass.

Use the following link to reference the pass:

https://pay.google.com/gp/v/object/{<issuerId>}.{<ObjectId>}

The pass can be viewed with the Google Pay app or a web browser.

Visszajelzés küldése a következővel kapcsolatban: