Stow Cards Wallet passes

Blog / Guides

How to create an Apple Wallet pass

There are two ways to make a pass people can add to Apple Wallet: build and sign the file yourself with an Apple Developer account, or let a pass platform do it for you. Here’s what each involves, step by step, so you can pick the one that fits.

Boarding passes, cinema tickets, coffee shop cards: they all live in Apple Wallet as the same kind of thing, a pass. If you want your own card, ticket or coupon in there, you need to create one. Apple publishes everything needed to do that from scratch, and plenty of businesses do. Many more never touch the file at all and use a platform instead.

We’ll cover both. We’ll use Harbor Coffee, our demo café, as the example throughout. It wants a loyalty card that shows each customer’s points, with a free coffee at 300.

What an Apple Wallet pass actually is

An Apple Wallet pass is a single file with a .pkpass extension. Inside, it’s a zip archive with four kinds of content:

  • pass.json, which describes the pass: who issued it, its serial number, its colors, the text in each field (say “Points: 290”) and the barcode.
  • The images, such as the icon, the logo and a strip across the card, in a couple of sizes for different screens.
  • manifest.json, a list of every file in the pass with a hash of its contents.
  • A signature of that manifest, made with a certificate Apple issued to the pass’s owner.

The signature is the important part. An iPhone won’t add a pass unless it’s signed with a valid certificate from Apple, and if any file changes after signing, the hashes no longer match and the pass is refused. That’s why you can’t just type up a pass.json and email it to customers.

Apple offers a handful of pass layouts, one each for boarding passes, event tickets, coupons and store cards, plus a generic one. The layout decides where the fields and images sit, so it’s worth picking before you design anything.

Option 1: Build and sign the pass yourself

This is the route Apple documents for developers. You’ll need a Mac (or another way to make a certificate signing request), some comfort with code and a server that can host files over HTTPS.

1. Join the Apple Developer Program

Pass certificates are only issued to members of the Apple Developer Program, which has an annual fee (US$99 a year in the US). An individual or a company can join, and a company needs a D-U-N-S number to sign up as one.

2. Register a Pass Type ID

In your developer account, under Certificates, Identifiers & Profiles, register a Pass Type ID. It’s a reverse-domain name that identifies one kind of pass, such as pass.com.harborcoffee.loyalty. Every pass you issue with that ID shares the same certificate.

3. Create the signing certificate

Make a certificate signing request (Keychain Access on a Mac does this), upload it against your Pass Type ID, and download the certificate Apple gives you. You’ll also need Apple’s intermediate certificate, the Worldwide Developer Relations certificate, because signatures are checked against both. Keep the private key safe. Anyone who has it can sign passes in your name.

4. Write pass.json and add the images

Fill in pass.json with your Pass Type ID, your team ID, a serial number that’s unique to this customer’s pass, your organization name, colors and the fields you want. For Harbor Coffee that’s the points balance, the customer’s name and a QR code holding their member number. Then add the images the layout needs. The icon is required on every pass, because it’s what shows on the lock screen.

5. Build the manifest, sign it and zip it

Hash each file into manifest.json, sign the manifest with your certificate and Apple’s intermediate certificate to produce the signature file, and zip the lot. Rename the zip so it ends in .pkpass. Most teams script this step, or use one of the open-source libraries that do it, because every pass for every customer goes through it.

6. Get it onto the phone

Host the file over HTTPS with the MIME type application/vnd.apple.pkpass, then share the link from a web page, an email or a button in your app. When someone opens it on an iPhone, Wallet shows the pass with an Add button.

7. Add a web service if the pass will change

Steps 1 to 6 give you a static pass. A loyalty card is anything but static: Harbor Coffee’s balance changes at every visit. For that, pass.json also carries the address of your web service and an authentication token. When someone adds the pass, their iPhone registers with your service. When the balance changes, your server sends a push through Apple’s push notification service, the iPhone asks your service what changed and downloads the new version of the pass. To show a message on the lock screen, such as “10 points to your free coffee”, you give the field a change message.

That web service is the part that turns a weekend project into an ongoing one. It has to stay up, keep track of every device, and you have to renew the certificate before it expires, or new passes stop installing and updates stop arriving.

And Android is a separate build

A .pkpass file doesn’t open in Google Wallet. Google Wallet has its own issuer account, its own API, where you define a class for the program and an object for each customer, and its own “Save to Google Wallet” link carrying a signed token. If your customers use both kinds of phone, you’re building, hosting and updating two passes.

Option 2: Use a pass platform, no code

A pass platform does the certificates, the signing, the hosting and the update service for you. You design the pass, and customers add it. Here’s what that looks like with Stow Cards.

1. Design the pass

Open the Pass Designer, which works without an account. Pick what you’re making, from loyalty and stamp cards to membership cards, coupons, gift cards and event tickets, then add your logo, colors and fields. The preview shows the pass as it will look in Apple Wallet and in Google Wallet as you go. How to design your first pass goes through the choices that make a card easy to read.

2. Publish it

When you’re happy with the design, create an account and publish. The program gets its own sign-up page and a QR code you can download and print. Stow Cards can sign your passes with its own managed Apple and Google credentials, so you don’t need an Apple Developer account or a Google Wallet issuer account. If you’d rather your passes came from your own accounts, you can upload your own certificates in the console instead.

3. Let customers add it

A customer scans the QR code, fills in a short form and taps the button for their phone. On an iPhone the pass goes into Apple Wallet. On an Android phone it goes into Google Wallet. Each pass carries a QR code with the customer’s own Member ID, such as 7K2Q9FMRDC. Adding your loyalty card to Apple Wallet and Google Wallet walks through this from the shop owner’s side.

If you’d rather issue passes from your own website or till system, the Stow Cards API does the same thing in code: creating a member returns an “Add to Apple Wallet” link and a “Save to Google Wallet” link you can send to the customer.

4. Keep it up to date

Staff scan the pass in the Stow Cards Merchant app and add points or a stamp, and the balance on the customer’s phone changes to match. You can send a message to every member as a push notification, and if you edit the design and save it, the passes already in people’s wallets update too. How live pass updates work explains what happens behind the scenes.

Which way should you choose?

Build it yourself if you have developers who’ll look after it, you want full control over every byte of the pass and the service behind it, and you’re happy to run certificates, hosting and an update service for as long as the passes are in use.

Use a platform if you’d rather spend your time on the card than the plumbing. That’s most cafés, salons, gyms, shops and event organizers: a pass in both wallets, a sign-up page, a scanner for the counter and live updates, without writing or hosting anything. You can still bring your own Apple certificate later, or connect your own systems through the API.

Getting started

You can design a pass in the Stow Cards Pass Designer right now, free and without an account. The Apple Wallet and Google Wallet pass types page shows every kind of pass you can make, and how it works covers the steps from design to a live pass.

Questions people ask

To build and sign passes yourself, yes: Apple only issues pass certificates to members of the Apple Developer Program. With a pass platform you usually don’t. Stow Cards can sign your passes with its own managed credentials, or with your own certificate if you’d rather they came from your Apple account.

Yes. A pass platform does the building, signing and hosting for you. In Stow Cards you design the pass in the Pass Designer, publish it, and customers add it to Apple Wallet or Google Wallet from a sign-up page or QR code.

A .pkpass file. It’s a zip archive holding pass.json, the pass images, a manifest of file hashes and a signature. Websites serve it with the MIME type application/vnd.apple.pkpass so an iPhone offers to add it to Wallet.

Yes, if the pass was built with an update web service. When the data changes, the server sends a push through Apple’s push service and the iPhone downloads the new version. In Stow Cards this is built in: balance changes and design edits reach the cards already in people’s wallets.

No. Android phones use Google Wallet, which has its own format and its own API. If you build passes yourself, that’s a second build. Stow Cards makes both from one design.

Create your first pass without code