# Set up Google Wallet API

Manage your Google Wallet API certificates and publishing access.

To enable Google Wallet in your Airship account you will need to complete a few steps in the Google Cloud Platform (GCP), Google Pay & Wallet Console, and within the Airship dashboard.

Generally, you will complete each section in the order presented in this guide.

> **Important:** You should ensure your use-case adheres to Google's [Acceptable Use Policies](https://pay.google.com/about/business/policy/#restricted-products-services). If any restrictions apply, you may encounter delays, or potentially have your use-case rejected. You can reach out to your account manager or Airship Support if you are unsure about your wallet use-case.


## Getting your Google Wallet API certificate

First, get a Google Wallet API Issuer ID. This ID is necessary to create and distribute passes for Google Wallet.

1. [Sign up on the Google Pay & Wallet Console](https://pay.google.com/business/console).
1. Go to *Google Wallet API* in the console and click **Build your first pass**. Once you accept the terms of service, you will be redirected to the Google Pay & Wallet Console, where your **Issuer ID** will be displayed. 
1. Copy and paste your Issuer ID to a place where you can access it later.

---

Next, 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 don’t 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.

---

next, **create a new Google Cloud service account and certificate**.

1. [Create a service account in the Google Cloud console](https://console.cloud.google.com/iam-admin/serviceaccounts/create) and provide your:
   * Service account name — Example: `Airship Wallet`
   * Service account ID — Example: `airship-wallet-account`
1. After entering the Service account ID, copy and paste the service account email address to a place where you can access it later. It will be formatted similarly to: `airship-wallet-account@my-project-id.iam.gserviceaccount.com`.
1. Click **Create and Continue**.
1. Click **Done**.
1. Select your new service account from the list. 
1. Go to the *Keys* tab, or click 
 and select *Manage keys*.
1. Click *Add Keys* and select *Create new key*.
1. Select *P12* and click **Create**. This will automatically download the certificate p12 file.

---

Finally, you must authorize the Google Cloud service account to call the Google Wallet API. To do so, grant the service account access to manage your Issuer Account.

In the [Google Pay & Wallet Console](https://pay.google.com/business/console):

1. Go to **Users** and click **Invite a user**.
1. Enter the email address for the service account you created in the Google Cloud console.
1. Select the *Developer* access level.
1. Click **Invite**.

## Adding your certificate to your Airship Wallet project

In your Airship Wallet project:

1. Go to *Settings » Certificates* and select *Android*.
1. (When replacing an existing certificate only) Click **Replace certificate**.
1. Enter the Issuer ID.
1. Enter the email address for the service account you created in the Google Cloud console.
1. Click **Choose file** and select your p12 file.
1. Click **Save**.

## Getting publishing access

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


First, [create your first Google Wallet template](https://www.airship.com/docs/guides/wallet/getting-started/project-template/#create-a-template) in your Airship 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 Airship 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. Click **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, you can request publishing access..

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