Save to Google Wallet

Let your users save a pass to Google Wallet from a website or email at the click of a button.

Airship provides an API function that returns JavaScript to render the Save to Google Wallet button with the necessary information to create a wallet object. All you need is the user information and any pass-specific details.

  • When the Save to Google Wallet button is rendered on the page, a user can hover over it to display the currently logged in account, with an option to change to a different account. If not logged in, a log in window appears.
  • After clicking the button while logged in with a valid Google account, the Google Object will be created and saved to the user’s wallet. Depending on how you configure the onSuccess JSON value, you can redirect to a different page or simply do nothing, and the Google JavaScript library will let the user know the card was successfully saved.
 Note

Pass creation via the API is the preferred method due to ease of use and implementation, but in some cases you may want to use the Save to Google Wallet method.

  1. Define the Origin URL:
    1. Go to Settings » API.
    2. Click Edit next to Save to Google Wallet.
    3. Enter the root URL where you want to place your Save to Google Wallet button, e.g., https://www.mysite.com.
       Note

      The Origin URL is a list of domains to allowlist JSON Web Token (JWT) saving functionality. The Save to Google Wallet button will not render if this field is not filled out properly.

    4. Click Save.
  2. Generate the JavaScript by making a POST call that generates the JavaScript you will use with Google’s integration instructions: POST /v1/pass/{templateID}/saveToWallet, with the template ID matching the template ID in your mobile wallet project. See Wallet API: Save to Google Wallet for full documentation.
  3. Follow the instructions provided by Google to Add the Save to Google Wallet button, including the JavaScript generated from the POST call.

Save to Google Wallet From Email

Save your users a click by adding a deep link to a pass from a Save to Google Wallet button in an email and from the subject line in Gmail.

Since the format of a Google Wallet pass URL is already a deep link, use that URL in a Save to Google Wallet button in an email or email subject line. Follow the instructions provided by Google: Add the Save to Google Wallet button to your email.