# Set up Google Wallet certificates and publishing access

Set up Google Wallet credentials, upload them to your wallet project, and request publishing access for live passes.

Google Wallet requires credentials that prove you can issue passes for your brand, plus publishing access from Google before live passes can reach users. Creating credentials is typically completed by a developer.

> **Important:** Ensure your use case adheres to Google's [Acceptable Use Policies](https://pay.google.com/about/business/policy/#restricted-products-services). Restrictions may cause delays or rejection. Contact your account manager or Airship Support if you are unsure about your wallet use case.


## Get your Google Wallet credentials and authorize access

Google requires proof that your organization is authorized to issue passes. These steps establish that authorization in Google Cloud and the Pay & Wallet Console so Airship can create passes on your behalf.

### Get your Issuer ID

Your Google Wallet API Issuer ID is necessary to create and distribute passes for Google Wallet. Get the ID:

1. Go to the [Google Pay & Wallet Console](https://pay.google.com/business/console).
1. Go to **Google Wallet API** in the console and select **Build your first pass**. After you accept the terms of service, your Issuer ID appears in the console.
1. Save your Issuer ID somewhere you can access when completing configuration in the Airship dashboard.

### Enable the Google Wallet API

Enable the Google Wallet API in the Google Cloud Platform:

1. [Log in to the Google Cloud Platform](https://console.cloud.google.com/). If you do not already have a GCP project, create one.
1. Enable the [Google Wallet API](https://console.cloud.google.com/apis/library/walletobjects.googleapis.com) for your project.

### Create a service account and certificate

Create a service account in Google Cloud and generate a .p12 certificate:

1. [Create a service account in the Google Cloud console](https://console.cloud.google.com/iam-admin/serviceaccounts/create) and enter an account name and ID.
1. After entering the service account ID, save the service account email address. It is formatted similarly to `airship-wallet-account@my-project-id.iam.gserviceaccount.com`.
1. Select **Create and Continue**, then **Done**.
1. Select your new service account from the list.
1. Go to **Keys**, or select the more menu icon () and **Manage keys**.
1. Select **Add Keys**, then **Create new key**.
1. Select **P12** and select **Create**, and the p12 certificate file will download locally.

### Authorize the service account

Grant the service account access to manage your Issuer Account so it can call the Google Wallet API:

1. Log in to the [Google Pay & Wallet Console](https://pay.google.com/business/console).
1. Go to **Users** and select **Invite a user**.
1. Enter the service account email address from the Google Cloud console.
1. Select the **Developer** access level.
1. Select **Invite**.

## Add a certificate to a wallet project

After you [create a wallet project](https://www.airship.com/docs/guides/getting-started/wallet/set-up-project/#create-a-wallet-project-and-template), use these steps to upload your certificate. That is usually a project you just created, but the same steps apply to any wallet project without a certificate.

Add a certificate:

1. Go to **Settings**, then **Certificates**, and select **Android**.
1. Enter the Issuer ID.
1. Enter the service account email address from the Google Cloud console.
1. Select **Choose file** and choose your .p12 file.
1. Select **Save**.

## Replace a certificate

Use this option when you need to upload a new certificate to your project, typically to replace an expiring certificate:

1. Go to **Settings**, then **Certificates**, and select **Android**.
1. Select **Replace certificate**.
1. Enter the Issuer ID.
1. Enter the service account email address from the Google Cloud console.
1. Select **Choose file** and choose your .p12 file.
1. Select **Save**.

## Get publishing access

Before you can publish live Google Wallet passes, you must create a Google Wallet API class, complete your Google Wallet API business profile, and then get approval from Google.

First, [create your first Google Wallet template](https://www.airship.com/docs/guides/getting-started/wallet/set-up-project/#create-a-wallet-project-and-template) in your wallet project. This will automatically generate your API class.

While you can manually create a class within the [Google Pay & Wallet Console](https://pay.google.com/business/console), creating your first Google Wallet template in the dashboard will generate a class for you and streamline the process.

Next, complete a Google Wallet API business profile:

1. Go to the [Google Pay & Wallet Console](https://pay.google.com/business/console).
1. Go to **Google Wallet API** in the sidebar.
1. Select **Complete business profile**.
1. Complete the **Business identity** and **Business information** sections of your business profile.

Google must approve your business profile before you can request publishing access. Once Google notifies you of approval, make your request:

1. Go to the [Google Pay & Wallet Console](https://pay.google.com/business/console).
1. Go to **Google Wallet API** in the sidebar.
1. Select **Request Publish Access** and follow the prompts.
