The PassKit + Iterable integration lets you issue and track Apple Wallet and Google Pay passes in your Iterable campaigns.
With this integration, you can create mobile wallet passes, embed them in your campaigns, track user interactions with passes, and update your passes based on user engagement.
In this article
Creating API keys
To set up this integration, you'll need to know how to create API keys in both Iterable and PassKit.
How to create an Iterable API key
In Iterable, create a server-side API key. To learn how, read API Keys.
How to create a PassKit API key
In PassKit, navigate to the program your members will be enrolled in.
-
Navigate to the Settings > Integrations.
Select Long Lived API Token.
-
Enter your account password and click Generate API Token.
-
Copy the API key to your clipboard, and save it somewhere secure. (You’ll use it in a later step.)
TIP
Keep a copy of your API key in a safe location. Once you close this menu, you won't be able to see it again.
Setup instructions
With this integration, you can:
- Sync PassKit pass events to an Iterable user profile.
- Update a user's mobile passes with Iterable journey webhooks.
- Retrieve your PassKit pass records with an Iterable data feed.
- Issue mobile wallet passes with an Iterable snippet.
Here's how to complete the integration setup for each of these use cases:
Sync PassKit pass events to an Iterable user profile
Create an Iterable API key. To learn how, read API Keys.
In PassKit, navigate to the program your users will be enrolled in.
-
Open the program, and click Settings.
Click the Integrations tab.
-
Find Iterable in the list, and click Configure.
-
Enter the Iterable server-side API key you created earlier.
Give the integration a name.
Switch the Enable integration toggle to “Yes”.
Under Set Pass Notifications, select which events you want to receive.
Click Save.
Now, you can see a user’s mobile wallet pass events on their Iterable user profile.
Update your PassKit pass records with Iterable journey webhooks
Create a PassKit long-lived API token.
In your Iterable project, navigate to Integrations > Journey webhooks.
Click New Webhook.
-
Give your webhook a name, and fill in the settings like this:
Destination: Custom
Method: PUT
-
Endpoint: https://api.pub1.passkit.io/members/member
NOTE
If you have requested a USA data instance from PassKit, change the
pub1
parameter in the URL topub2
. Authentication: None
-
Custom headers:
Name: Authorization
-
Value: Bearer YOUR_PASSKIT_API_KEY
Body: JSON
-
Payload:
{ “programId”: “program_id”, “externalId”: “{{email}}” }
NOTE
This is the minimum required payload, but you can include additional information (like the user's name). For a full list of available values, see PassKit’s documentation.
For
programId
, you can provide either a static value or pull it from your user record if you provided it upon signup. This request body becomes a PassKit member record.
Click Create webhook.
You can now update mobile wallet passes from your Iterable journeys.
Retrieve your PassKit pass records with an Iterable data feed
Create a PassKit long-lived API token.
In your Iterable project, navigate to Content > Data feeds.
Click Create new feed.
-
Give your data feed a name, and fill in the settings like this:
Template handlebars alias: pk_member
-
URL:
https://api.pub1.passkit.io/members/member/externalId/{{programId}}/{{email}}
NOTE
If you have requested a USA data instance from PassKit, change the
pub1
parameter in the URL topub2
.If you don’t have the
programId
in your data instance, you can access this in your PassKit account. Authorization token: Bearer YOUR_PASSKIT_API_KEY.
Click Save feed.
You can now reference PassKit member record data in your Iterable templates!
TIP
When referencing a PassKit member record, you can use response objects to include additional values.
Issue PassKit passes with an Iterable snippet
-
In PassKit, navigate to the membership program you want to enroll users in.
NOTE
We recommend starting out with a Draft program in PassKit. Passes issued through Draft programs don’t impact your monthly PassKit bill.
-
Click the Distribution tab in the header, then click SmartPass Links, followed by Command Line Tool.
(To learn more about SmartPass links, see Passkit’s documentation.)
-
Scroll down to Details, and copy your PassKit URL and Project Secret.
In a new browser tab, open your Iterable project.
Click the gear icon and select Project Settings.
-
Scroll down to the HMAC Secret field, and paste in your PassKit project secret.
Click Save.
Navigate to Content > Snippets.
-
Click New Snippet.
NOTE
To learn more about creating and using snippets in Iterable, see Snippets Overview.
-
Give your snippet a name.
-
Click the Source button in the text editor, then paste in the following:
{{#assign "url"}} your_url_here {{/assign}} {{#assign "link"}} {{url}}?data={{#base64}} { "members.member.externalId": "{{email}}" } {{/base64}} {{/assign}} <a href="{{link}}&sig={{ hmacSHA1 link }}">Click Here For Your Pass</a>
-
Replace
your_url_here
with the PassKit URL you copied earlier. This block will now create hashed SmartPass links on the fly when you send Iterable campaigns.NOTE
This code block contains the minimum number of fields required for PassKit to create a pass: { "members.member.externalId": "{{email}}" }
You can add additional fields to further personalize your membership cards. For a full list of available PassKit SmartPass fields, go here
. To test your code block, navigate to Content > Templates.
-
Open one of your existing templates, or create a new one.
NOTE
If you don’t have any templates yet, you’ll need to create one first. (See Templates Overview).
-
Paste your snippet into your test template.
Scroll down and preview the template with data.
Make sure that you load user data, as the snippet requires at least an email address to work.
-
You should see a link populate in the template. (When you hover over the linked text, you should see the full link in the bottom of your browser window.)
-
Clicking the link should redirect you to a PassKit pass landing page.
-
Navigate back to your PassKit portal, where you can see you have now issued a pass.
NOTE
If you want to run the test again, you’ll need to use another email address or delete this membership record in PassKit.