Get access to the Android SDK

The Google Pay API for Passes for Android lets users save loyalty cards, gift cards, offers, event tickets, boarding passes for flights, and transit passes to Google Pay with the click of a button. This tutorial guides you through how to integrate Save to Google functionality into your Android app.

The API is provided as part of Google Play Services, which provides core functionality for Android apps. For the purposes of this tutorial, we assume that you're familiar with the basic concepts and skills of application development for the Android platform. If you need to learn about Android development before you get started, work through some lessons in the Training for Android Developers.

To get started with this tutorial, obtain credentials for your project and set up Google Play Services.

Obtain credentials to authorize your app

To successfully use the Google Pay API for Passes for Android in your Android app, you need to authorize the app. Do this with the SHA1 fingerprint in your developer's key and the package name.

To get approval for your application, you need to get the certificate's SHA1 fingerprint. To find the fingerprint, open a terminal window and run the Keytool utility:

keytool -alias androiddebugkey -keystore path_to_debug_or_production_keystore -list -v

For the debug keystore, the password is android.

The Keytool prints the fingerprint to the shell. For example:

$ keytool -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v
Enter keystore password: Type "android" if using debug.keystore
Alias name: androiddebugkey
Creation date: Aug 27, 2012
Entry type: PrivateKeyEntry
Certificate chain length: 1
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 503bd581
Valid from: Mon Aug 27 13:16:01 PDT 2012 until: Wed Aug 20 13:16:01 PDT 2042
Certificate fingerprints:
   MD5:  1B:2B:2D:37:E1:CE:06:8B:A0:F0:73:05:3C:A3:63:DD
   SHA1: D8:AA:43:97:59:EE:C5:95:26:6A:07:EE:1C:37:8E:F4:F0:C8:05:C8
   SHA256: F3:6F:98:51:9A:DF:C3:15:4E:48:4B:0F:91:E3:3C:6A:A0:97:DC:0A:3F:B2:D2:E1:FE:23:57:F5:EB:AC:13:30
   Signature algorithm name: SHA1withRSA
   Version: 3

Copy the SHA1 fingerprint, which is highlighted in the preceding example. The fingerprint as well as the package name of the app are needed to authorize the app. The app can be authorized by reaching out to the support team through the Business Console contact support widget.

Set up Google Play Services

If you don't already have Android Studio, download and install Android Studio.

The Google Pay API for Passes for Android is part of Google Play services. To import Google Play services libraries, follow the instructions to Set Up Google Play services.

In particular, to import the Google Pay API for Passes for Android, add the following to the dependencies block to the build.gradle file in the app module:

dependencies {
    implementation ''

After you complete this setup process, try to save to Google Pay by following the steps in Use the Android SDK.