Add tickets to Apple Wallet and Google Wallet
A template can make a wallet pass with every render: an Apple Wallet pass and a Google Wallet pass with the same fields and code as the PDF. Each render returns a link to each pass. Put the links in the PDF as buttons, in the email you send the PDF with, or on your booking page.
A PDF can’t add itself to a wallet, so the buttons are links: opening the Apple link on an iPhone adds the pass to Wallet, and the Google link opens Google Wallet to save it.
Before you start
Section titled “Before you start”- Your own wallet accounts. Passes are signed with them, so they show your company, not
Typefold:
- Apple Wallet needs an Apple Developer Program membership.
- Google Wallet needs a free issuer account in the Google Pay & Wallet Console and a Google Cloud project.
- A workspace owner or admin to set up the accounts in Studio.
You can set up one wallet or both. Templates link only to the wallets you set up.
Set up the wallets
Section titled “Set up the wallets”In Studio, open Developers → Wallet passes.
Apple Wallet
Section titled “Apple Wallet”- In your Apple Developer account, open Certificates, Identifiers & Profiles →
Identifiers, add a Pass Type ID such as
pass.com.example.tickets, and create its certificate. - Open the certificate on a Mac so it is added to Keychain Access. Select it with its private
key and export both as a
.p12file with a password. - In Studio, click Set up Apple Wallet, choose the
.p12file and enter its password.
Studio shows the pass type, team and the date the certificate expires. Apple certificates last a year: before then, create a new one and click Replace.
Google Wallet
Section titled “Google Wallet”- In the Google Pay & Wallet Console, open Google Wallet API and note your issuer ID.
- In the Google Cloud console, enable the Google Wallet API, create a service account and download a JSON key for it.
- Back in the Wallet console, under Users, invite the service account’s email address as a developer.
- In Studio, click Set up Google Wallet, enter the issuer ID and choose the JSON key file.
Until Google approves your issuer for publishing, only the test accounts you add in the Wallet console can save passes.
Keys are stored encrypted and are never shown again.
Add a pass to a template
Section titled “Add a pass to a template”In the visual editor, click an empty part of the page so the Page panel shows, then Set up beside Wallet pass. In the code editor, click the wallet icon beside PDF properties. Then click Add wallet pass:
| Setting | What it does |
|---|---|
| Style | Boarding pass, event ticket, coupon or other. A boarding pass also asks how people travel. |
| Issuer | Your company’s name on the pass. |
| Description | What the pass is, read out by screen readers. |
| Fields | A label and a value each, placed at the top, on the main line, in the rows below, or on the back. |
| Code | A QR, PDF417, Aztec or Code 128 code, such as the ticket number. |
All settings adds the text beside the logo, the date the pass is relevant (phones show it on
the lock screen then), an expiry date and the pass colours. Dates are ISO 8601 date-times, such
as 2026-12-01T08:30:00+02:00.
Every value can use {{path}} placeholders that take values from the render data, as the
PDF properties do: {{passenger.name}}, {{ticket.number}}. A field
whose value is empty in a render is left off the pass.
The pass logo is your brand kit logo. Apple Wallet shows it when it is a PNG.
The pass is saved in the template’s page.json as walletPass, so it is published with the
template. Publish the template to start making passes.
Put the links in the PDF
Section titled “Put the links in the PDF”Each render fills $wallet in the template’s data with the links:
| Value | Link |
|---|---|
$wallet.apple |
The Apple Wallet pass, when Apple Wallet is set up. |
$wallet.google |
Google Wallet’s save page, when Google Wallet is set up. |
In an HTML template, link a button or an image to them:
{{#if $wallet.apple}} <a href="{{$wallet.apple}}"><img src="add-to-apple-wallet.svg" alt="Add to Apple Wallet" /></a>{{/if}}{{#if $wallet.google}} <a href="{{$wallet.google}}"><img src="add-to-google-wallet.svg" alt="Add to Google Wallet" /></a>{{/if}}Use the badges Apple and Google provide, as their guidelines ask.
In the visual editor, add a QR code and type {$wallet.apple} or {$wallet.google} as its
value: scanning it with a phone opens the pass, which suits a printed ticket.
Previews link to an example address that answers 404, so you can see the buttons without
making a pass. Request data can’t set $wallet.
Get the links from a render
Section titled “Get the links from a render”The Reports API returns them in the wallet-pass-apple and
wallet-pass-google response headers:
curl -D - -o ticket.pdf "https://app.typefold.dev/v1/reports/render" \ -H "x-api-key: YOUR_API_KEY" \ -H "content-type: application/json" \ -d '{ "template": { "name": "Ticket" }, "format": "pdf", "data": { "passenger": { "name": "Mari Maasikas" }, "ticket": { "number": "TCK-1001" } } }'The Renders API returns them as walletPass on the render, from the
moment it is created:
{ "id": "…", "state": "queued", "walletPass": { "apple": "https://app.typefold.dev/v1/wallet-passes/…/apple", "google": "https://app.typefold.dev/v1/wallet-passes/…/google" }}using Typefold.Client;
var client = new TypefoldClient( new Uri("https://app.typefold.dev"), "YOUR_API_KEY");
Render render = await client.CreateRenderAsync(new TemplateRenderRequest{ Template = TemplateRef.ByName("Ticket"), Data = new { passenger = new { name = "Mari Maasikas" }, ticket = new { number = "TCK-1001" } },});
Console.WriteLine(render.WalletPass?.Apple);Console.WriteLine(render.WalletPass?.Google);import { TypefoldClient, TemplateRef } from "@typefold/client";
const client = new TypefoldClient({ baseUrl: "https://app.typefold.dev", apiKey: "YOUR_API_KEY",});
const render = await client.createRender({ template: TemplateRef.byName("Ticket"), data: { passenger: { name: "Mari Maasikas" }, ticket: { number: "TCK-1001" } },});
console.log(render.walletPass?.apple, render.walletPass?.google);import { TypefoldClient, TemplateRef } from "@typefold/client";
const client = new TypefoldClient({ baseUrl: "https://app.typefold.dev", apiKey: "YOUR_API_KEY",});
const render = await client.createRender({ template: TemplateRef.byName("Ticket"), data: { passenger: { name: "Mari Maasikas" }, ticket: { number: "TCK-1001" } },});
console.log(render.walletPass?.apple, render.walletPass?.google);from typefold import TemplateRef, TemplateRenderRequest, TypefoldClient
client = TypefoldClient("https://app.typefold.dev", "YOUR_API_KEY")
render = client.create_render( TemplateRenderRequest( template=TemplateRef.by_name("Ticket"), data={"passenger": {"name": "Mari Maasikas"}, "ticket": {"number": "TCK-1001"}}, ))
if render.wallet_pass: print(render.wallet_pass.apple, render.wallet_pass.google)The links need no API key, so they can go in an email or on a web page. Anyone with a link can add the pass, as with a PDF download link.
How long links work
Section titled “How long links work”- A pass link works for a year after the render, even after the render’s PDF is deleted.
- A test render’s pass says TEST and its links work for a day.
- Removing a wallet account in Studio stops that wallet’s links from working.
- If the workspace has no wallet set up, renders of a template with a pass fail and say so.
Passes don’t change after they are made. To change a ticket, render it again and send the new links.