Mobile Wallet Loyalty Cards Setup
This guide explains how to configure Apple Wallet and Google Pay passes in Mercury.
Apple Wallet
Apple Wallet passes (loyalty cards, coupons, etc.) are grouped under a Pass Type Identifier, a reverse-DNS string that identifies your organization and pass category (for example, com.mycompany.loyalty.tier1
). Each individual pass is distinguished by a serialNumber, so the combination of passTypeIdentifier + serialNumber
must be unique—adding the same pair will overwrite the existing pass on a user’s device.
Step 1: Create a Pass Type Identifier
-
Sign in to your Apple Developer account and navigate to Certificates, Identifiers & Profiles → Identifiers.
-
Click Add (+), select Pass Type ID, then click Continue.
-
Enter a descriptive name and your reverse-DNS identifier (e.g.
com.yourcompany.loyalty.card
), then register.
Step 2: Create the Certificate (Windows)
Install OpenSSL
CSR files are generated using OpenSSL, which can be found here.
Download and run the most recent Light installer. The wizard will ask you to select where OpenSSL should be installed. Keep the default location. Additionally, when prompted, instruct the installer to copy OpenSSL's DLLs to The Windows system directory.
Generate a Certificate Signing Request
- Open an administrator command prompt.
- Create a folder to place your CSR.
cd
to your cert folder:cd C:\certificates\apple-pass
- Generate a private key:
set RANDFILE=.rnd
openssl genrsa -out apple_pass.key 2048 - The file,
apple_pass.key
, will be output to the selected folder. - Create a CSR (replace placeholders with your email and name) by running the following command:
openssl req -new ^
-key apple_pass.key ^
-out apple_pass.csr ^
-subj "/[email protected],CN=Your Name,C=US" - The CSR file,
apple_pass.csr
, will be output to the selected folder.
Create the Certificate
-
In the Apple portal under Pass Type ID → Certificates, choose to create a certificate
of the type
"Pass Type ID Certificate"
-
Upload newlly created CSR
apple_pass.csr
-
Download the resulting
pass.cer
file. -
Convert and bundle into PKCS#12:
openssl x509 -in pass.cer -inform DER -out apple_pass.pem -outform PEM
openssl pkcs12 -export ^
-inkey apple_pass.key ^
-in apple_pass.pem ^
-out apple_pass.p12 ^
-passout pass:<YOUR_P12_PASSWORD>
Step 3: Configure Mercury
-
In your Mercury admin console, go to Loyalty Programs and select the program you want to enable Apple Wallet for.
-
Open the Apple Pass tab.
-
Upload your
apple_pass.p12
certificate. -
Fill in the following settings (replace placeholder values with your own):
Setting Value / Notes Organization Name Your brand name as displayed on the pass Pass Type Identifier The reverse-DNS ID you registered (e.g. com.yourcompany.loyalty.card
)Team Identifier Your Apple Developer Team ID
You can find your Team ID at https://developer.apple.com/account by clicking on the "Membership Details" icon.Description Brief description of the loyalty program Logo Text Alt-text for the logo image Background Color Hex code for the card background (e.g. #FFFFFF
)Label Color Hex code for field labels Foreground Color Hex code for field values Terms & Conditions Link text and URL for your terms & conditions. In the Link field enter the entire <a href> HTML tag Apple WWDR Certificate Apple’s intermediate (WWDR) certificate (download from Apple’s Certificate Authority).
Select the first of the Worldwide Developer Relations certificatesApple Authentication Token Shared secret used to authenticate your pass-issuing API.
Apple requests have an authentication header in the form ofApplePass XXXXXXXX
For each loyalty program that generates Apple Wallet Passes provide a separate authentication token.infoThe URL of Apple requests is of the following format
https://<YOUR_API_ROOT>/v1/passes/{passTypeIdentifier}/{serialNumber}
You need setup the WebApiRootUrl Application Setting to the first parthttps://<YOUR_API_ROOT>
. -
Provide required pass assets (filenames and exact dimensions):
Filename Use Dimensions icon.png
Displayed on lock screen and in Mail previews 29 × 29 [email protected]
High-resolution lock-screen & mail preview 58 × 58 logo.png
Displayed in top-left corner next to the logo text 160 × 50 [email protected]
High-resolution logo 320 × 100 strip.png
Background strip behind primary fields 375 × 123 [email protected]
High-resolution strip 750 × 246
-
Click Save to apply your changes.
-
Mercury will now generate
.pkpass
files at runtime and serve them via your API endpoint.Developer noteMercury generates Apple Wallet passes via the
PassesHelper.GenerateApplePassForCard
method, which produces a.pkpass
package.To verify your pass, upload the generated file to the Pkpass Validator and confirm there are no errors.
Google Wallet
To create Google Wallet passes you need Google Wallet API issuer account and a Google Cloud account. Google uses the concept of classes and objects. A loyalty class is a blueprint to create loyalty objects (the actual passes). You can create multiple loyalty classes, for example one for each loyalty tier.
Step 1: Setup prerequisites
Follow the instructions on Google's onboarding guide (steps 2 & 3) to create a Google Wallet API Issuer account and Generate REST API credentials (requires a Google Cloud account).
Step 2: Configure Mercury
Upload the .json service account key generated on the previous step to the Google Pass tab of your Loyalty Program in Mercury in the field ServiceAccount
.
In your Application Settings, add or update the following keys to enable Google Wallet integration:
Key | Value | Notes |
---|---|---|
GoogleWallet.ServiceAccountEmailAddress | [email protected] | The service account email from your Google Cloud JSON key. |
GoogleWallet.ApplicationName | Your Loyalty Program Name | A friendly name for your loyalty program (display only). |
GoogleWallet.IssuerId | <YOUR_ISSUER_ID> | Your numeric Google Wallet Issuer ID. To locate this go to Google Pay & Wallet Console select Business Profile from the menu and on the top bar you will see your merchant (issuer) ID |
GoogleWallet.Origins | http://localhost, https://www.yourdomain.com, https://webapi.yourdomain.com | A comma-separated list of allowed origin URLs that will serve the Wallet pass. Include your development, staging and production URLs. |
VirtualFileRootWithDomain | https://www.yourdomain.com/userfiles | Base URL from which Google Wallet–related assets (images, logos, etc.) will be served. |
To preview your Google Wallet Pass design, try the Generic Pass Builder on Google Developers site.