Skip to content

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.

  • Your own wallet accounts. Passes are signed with them, so they show your company, not Typefold:
  • 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.

In Studio, open Developers → Wallet passes.

  1. 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.
  2. Open the certificate on a Mac so it is added to Keychain Access. Select it with its private key and export both as a .p12 file with a password.
  3. In Studio, click Set up Apple Wallet, choose the .p12 file 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.

  1. In the Google Pay & Wallet Console, open Google Wallet API and note your issuer ID.
  2. In the Google Cloud console, enable the Google Wallet API, create a service account and download a JSON key for it.
  3. Back in the Wallet console, under Users, invite the service account’s email address as a developer.
  4. 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.

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.

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.

The Reports API returns them in the wallet-pass-apple and wallet-pass-google response headers:

Terminal window
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"
}
}

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.

  • 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.