> For the complete documentation index, see [llms.txt](https://docs.webtonative.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webtonative.com/javascript-apis/wallet/wallet-creating-passes/wallet-creating-passes-ios.md).

# Wallet Creating Passes - iOS

This page covers the part that happens **before** you ever call `Wallet.addPasses` — building and signing the `.pkpass` file itself. WebToNative never creates, edits, or signs a pass; it only hands whatever `.pkpass` URL or base64 data you give it to Apple Wallet. See [Google Wallet / Apple Wallet](/javascript-apis/wallet.md) for the JS API this feeds into, and [Google Wallet (Android)](/javascript-apis/wallet/wallet-creating-passes/wallet-creating-passes-android.md) for the Android side.

Unlike Google Wallet, there's no live API call per pass — you build and sign an actual file, once per pass, on a Mac.

### Prerequisites

* An active **Apple Developer Program** membership.
* A macOS machine with **Keychain Access** available.
* The **WWDR (Worldwide Developer Relations)** intermediate certificate installed.

***

## 1. Create the Pass Type ID

1. Log in to the [Apple Developer Portal](https://developer.apple.com/account/resources/identifiers/list/passTypeId).
2. Navigate to **Certificates, Identifiers & Profiles** → **Identifiers**.
3. Click **+** (Add), select **Pass Type IDs**, and click **Continue**.
4. Enter a description and set the identifier — e.g. `pass.com.example.loyalty`.
5. Click **Continue**, then **Register**.

## 2. Generate a Certificate Signing Request (CSR)

1. Open **Keychain Access** on your Mac.
2. **Keychain Access** → **Certificate Assistant** → **Request a Certificate from a Certificate Authority…**
3. Enter your email address and name. Leave **CA Email Address** blank.
4. Select **Saved to disk** and click **Continue**.
5. Save the resulting `.certSigningRequest` file.

## 3. Generate the Pass Type ID Certificate

1. In the Developer Portal, go to **Certificates** and click **+** (Add).
2. Under **Services**, select **Pass Type ID Certificate** and click **Continue**.
3. Name the certificate and pick the Pass Type ID you created in step 1.
4. Click **Continue**, then **Choose File** to upload the CSR from step 2.
5. Click **Continue**, then **Download** to get `pass.cer`.

## 4. Install the Certificate into Keychain

1. Double-click the downloaded `pass.cer` to import it into Keychain Access.
2. In Keychain Access, select the **login** keychain and open the **My Certificates** tab.
3. Confirm your new certificate is listed as `Pass Type ID: <your identifier>`.
4. Expand it — a **private key** should be nested directly underneath. If it isn't, the CSR/certificate pairing didn't complete correctly.

## 5. Verify the WWDR Intermediate Certificate

Signing requires Apple's **WWDR (Worldwide Developer Relations)** intermediate certificate to be present and valid in your Keychain. If it's missing or expired, download the current one from Apple's PKI repository and install it.

{% hint style="danger" %}
If signing later fails with `Couldn't find an identity for <your pass type identifier>`, it almost always means one of steps 1–5 didn't complete — most commonly a missing WWDR certificate, or a certificate imported without its private key.
{% endhint %}

***

## 6. Get a Sample Pass Bundle

A `.pass` bundle is just a folder: a `pass.json` file plus images (`icon.png`, `logo.png`, and their `@2x`/`@3x` variants). Rather than building one from scratch, start from Apple's own samples:

1. From [Apple's PassKit documentation](https://developer.apple.com/documentation/walletpasses), download the **Wallet Support Materials** (sample project archive).
2. Unzip it — inside is a set of sample bundles (e.g. `BoardingPass.pass`, `Coupon.pass`, `Generic.pass`) and an Xcode project called **signpass**, which you'll use to sign passes in step 8.
3. Pick the sample closest to what you're building and open its `pass.json`.
4. Update `passTypeIdentifier` and `teamIdentifier` to match your own configuration, and adjust the rest of the fields for your pass:

```json
{
  "passTypeIdentifier": "pass.com.example.loyalty",
  "teamIdentifier": "YOUR_TEAM_ID",
  "formatVersion": 1,
  "organizationName": "Your Organization",
  "description": "Sample Boarding Pass"
}
```

## 7. Build the `signpass` Tool

1. Open `signpass.xcodeproj` (found inside the Wallet Support Materials you downloaded) in Xcode.
2. **Product** → **Build** (`Cmd+B`).
3. Locate the compiled binary — right-click it under **Products** in Xcode and choose **Show in Finder** — and note its full path.

## 8. Sign the Pass

In Terminal, run `signpass` against your `.pass` folder:

```bash
~/Library/Developer/Xcode/DerivedData/signpass-*/Build/Products/Debug/signpass \
  -p ~/Documents/BoardingPass.pass
```

`signpass` generates the manifest (hashing every file in the bundle), signs it using the Pass Type ID certificate from your Keychain, and zips the result into a single `.pkpass` file — verify `BoardingPass.pkpass` was created alongside the source folder.

## 9. Convert to Base64 (Optional)

If you'd rather send the pass as data than host it at a URL, base64-encode the `.pkpass`:

```bash
base64 -i BoardingPass.pkpass -o boardingpass_base64.txt
```

The contents of `boardingpass_base64.txt` are the string you hand to `Wallet.addPasses` as `base64s`.

***

## Handing It to WebToNative

```javascript
// Hosted at an HTTPS URL (serve with Content-Type: application/vnd.apple.pkpass)
window.WTN.Wallet.addPasses({
  urls: ["https://example.com/passes/loyalty-card.pkpass"],
});

// Or as base64 data
window.WTN.Wallet.addPasses({
  base64s: [pkpassBase64String],
});
```

***

## See Also

* [Google Wallet / Apple Wallet](/javascript-apis/wallet.md) — the `Wallet.*` JavaScript API this feeds into.
* [Google Wallet (Android)](/javascript-apis/wallet/wallet-creating-passes/wallet-creating-passes-android.md) — the Android side of pass creation.
* [Apple's PassKit documentation](https://developer.apple.com/documentation/walletpasses)
