Prerequisites

Stay organized with collections Save and categorize content based on your preferences.

Before you use the Google Wallet API for an integration, complete the following steps:

1. Sign up for a Google Wallet API Issuer account

An Issuer account is necessary to create and distribute passes for Google Wallet. Sign up for Google Pay and Wallet Console to get your issuer account. After you complete your Business profile, navigate to the Google Wallet API page and click Request access. Indicate in the use case that you plan to use Google Wallet API for this implementation, complete the checklist, and submit the request.

While you wait for approval of your Issuer account, create a temporary developer account or try out the Codelab.

2. Enable the Wallet API

3. Create a service account

A service account and a service account key are necessary to call the Google Wallet API. The service account is the identity that calls the Google Wallet API. The service account key contains a private key that identifies your application as the service account.

Create a service account:

  • 1.Create a service account in the Google Cloud Console, providing the following details:
    • Service account name - example: Wallet Web Client
    • Service account ID - example: my-service-account
  • 2. Click CREATE AND CONTINUE.
  • 3. Click DONE.

Create a service account key:

  • 1. Select your service account. For example: my-service-account@my-project-id.iam.gserviceaccount.com.
  • 2. Click on the KEYS menu item at the top of the page.
  • 3. Click ADD KEY and Create new key.
  • 4. Select key type JSON.
  • 5. Click CREATE to create and download the service account key.

4. Authorize the service account

You must authorize the service account in order to call the API. To authorize it, grant the service account access to manage your Issuer Account.

  • Visit the Users page in the Google Pay and Wallet Console.
  • 1. Click Invite a user.
  • 2. Add the service account's email address. For example: my-service-account@my-project-id.iam.gserviceaccount.com.
  • 3. Select Developer for Access level.
  • 4. Click Invite.

5. Create a class

Before you can create and add a LoyaltyObject, you must create a LoyaltyClass. To do so, sign in into the Google Pay and Wallet Console, navigate to the Google Wallet API page, and create a new Loyalty class.

  1. Select the Manage tab.
  2. Click Create a class.
  3. Choose Loyalty.
  4. Complete all mandatory fields with *.
  5. Click Create class.

Repeat the steps on this page if you require multiple loyalty cards.

Refer to the Layout template for more information on how these attributes are represented on the pass.

After you successfully create a Loyalty class, proceed to Add passes to Google Wallet.