Create a Google digital pass template
This guide will show you how to create an Apple digital pass template, which is required to format a Compact or Compact Semantic Credential as a Google digital pass.
Prerequisites
You need the following in order to proceed with this tutorial:
Access to MATTR VII APIs. If you’re experiencing any difficulties, contact us.
Design a Google pass template and save it as a
template.zip
bundle file:Download a Compact Credential sample Google digital pass template.
Download a Compact Semantic Credential sample Google digital pass template.
Credentials associated with your organisation's Google account.
Request
Make the following request to create a Compact Credential Google digital pass template:
1POST https://YOUR_TENANT_URL/core/v2/credentials/compact/digitalpass/google/templates
You can make a similar request to a different endpoint to create a Compact Semantic Credential Google pass template:
1POST https://YOUR_TENANT_URL/core/v2/credentials/compact-semantic/digitalpass/google/templates
Request body
1{
2 "template": {
3 "value": fs.createReadStream("WorkingLoyaltyPass.zip"),
4 "options": {
5 "filename": "WorkingLoyaltyPass.zip",
6 "contentType": null
7 }
8 },
9 "name": "example",
10 "issuerId": "xxxxx",
11 "serviceAccountClientEmail": "xxxxx",
12 "serviceAccountPrivateKey": "xxxxx"
13}
template:
Include your template files.name
: Insert a name to identify this Google digital pass template.issuerId
: Google Wallet Pass signer issuer ID.serviceAccountClientEmail
: Email address of the Google Cloud Platform service account for accessing the Google Pay Passes API.serviceAccountPrivateKey
: Private key PEM of the Google Cloud Platform service account.
Click here to find out more about how to grant access to your service account to call the Google Wallet API.
Response
1{
2 "id": "0793fade-bd27-46a8-8dfe-67c4d3e9cf09",
3 "name": "example",
4 "passType": "google",
5 "metadata": {
6 "issuerId": "xxxxx",
7 "serviceAccountClientEmail": "xxxxx",
8 "payPassId": "xxxxx"
9 }
10}
id
: This is a unique identifier for this Google digital pass template. You will use it as thetemplateId
when formatting a Compact Credential as a Google digital pass.All other fields in the response include information retrieved from your Google digital pass template.
Errors may occur in the following scenarios:
Unable to decompress the bundle.
template.json
is missing from the bundle or malformed.The bundle file exceeds the maximum size allowed.
To avoid potential impact on previously generated Google digital passes, updating an existing template will always create a new template in the Google Pay Business Console.