generatePass
Generate a wallet pass
Generates a wallet pass from a published template. For Apple passes (default),
returns a signed .pkpass binary file directly. For Google passes
(wallet_type: "google"), returns a JSON object containing a save_url
that the user can open to add the pass to Google Wallet.
When wallet_type: "both", generates both Apple and Google passes in a single
call. The response is always JSON with apple and google keys. Partial success
is allowed — if one wallet fails, the other is still returned with a warning.
Returns 201 if at least one succeeds.
The pass ID is returned in the X-Pass-Id response header (for single-wallet).
If the app has a validation webhook configured, the webhook is called once before generation (not per wallet type). A webhook rejection returns 403; a webhook error returns 502 (fail-closed).
Scope: passes:create
Maps to OpenAPI operationId generatePass — POST /generate-pass.
Same PassFast HTTP API, billing, and rate limits. Do not invent other paths.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Dynamic field values merged into the template structure. | |
| x_app_id | No | Override X-App-Id for this call. Defaults to the MCP connection header. | |
| locations | No | GPS locations where the pass is relevant (shown on lock screen). Overrides template defaults if provided. | |
| expires_at | No | Optional expiration timestamp for the pass. | |
| external_id | No | Optional external identifier for cross-system lookups. | |
| template_id | Yes | ID of the published template to use. | |
| wallet_type | No | Target wallet platform. Defaults to `apple`. When set to `google`, the response is a JSON object with a `save_url` instead of a binary .pkpass file. When set to `both`, generates both Apple and Google passes in one call and returns a JSON object with `apple`, `google`, and `warnings` keys. | apple |
| max_distance | No | Maximum distance in meters from a location for lock screen relevance. | |
| get_or_create | No | When true, if a pass with the same serial_number already exists and is active, return the existing .pkpass (200) instead of a 409 error. The response includes an `X-Pass-Existed: true` header. If the existing pass is voided/expired, returns 409. When false (default), duplicate serials always return 409. | |
| relevant_date | No | ISO 8601 date when the pass is relevant (appears on lock screen). | |
| serial_number | Yes | Unique serial number for this pass. | |
| strip_image_id | No | Override the template's strip/hero image for this pass only. The referenced image must belong to the same app and have purpose `strip` (or a `strip_*` variant). Applied to Apple `strip.png` and Google `heroImage` atomically (same value for both wallets in `wallet_type: "both"`). Omit or send `null` to use the template's strip image. |