create_template
Create a wallet pass template with design overrides, NFC, barcode, and fields. Certificate provisioning runs in background; re-read template to confirm.
Instructions
Create a new pass template. Only name and type are required. Use pass to override colors, fields, barcode, NFC, and image references. The response returns status: 'active' immediately, but the Apple certificate, Google Wallet class and Stripe meters provision in the BACKGROUND and are written back a few seconds later — so passTypeId / appleCertificates are usually still null in the create response. Re-read the template with get_template before concluding that certificate provisioning failed. NFC: set pass.nfc: true (and enableNFC: true) BEFORE creating; the certificate is issued with the NFC entitlement based on that flag at provision time.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Template display name. | |
| pass | No | Pass design overrides. Most useful keys: backgroundColor, textColor, labelColor, logo, hero, icon, strip, rows, linkRows, header, barcode, nfc. Inside rows / linkRows / header you can send field shorthand like { id: "memberName", label: "Member" } — the server fills fieldValue, name and (for known ids like balance) googleId. Image fields accept either { preview: "https://…" } or { fileId: "file_…" } from POST /files. STAMP CARDS (loyalty): set `useStampCollection: true`, `stampCount: <n>`, `stamp: { fileId }` (icon — `purpose: 'template_stamp'`), AND `hero: { fileId }` (REQUIRED — the wide banner that stamps are composited onto as a dimmed background, `purpose: 'template_hero'`). Without `hero` the server skips banner generation and the pass shows no stamps. Both images must be supplied for stamps to render. VALUES: every `fieldValue: 'custom'` block — in `header`, `rows` and `linkRows` alike — is filled at issue time from `templateFields[id]` on create_pass. Do not put display values in the template itself. APPLE STRIP: Apple's banner is generated from the hero you supply here; if you supply none, the pass falls back to a stock per-type image that will not match the business. Supply a `hero` fileId for any customer-facing template. ICON: ALWAYS supply one, sourced from the business's own website — omit it and the pass ships the WALLETAP logo, which is the most visible way for a customer's card to look unfinished. Their icon is declared in their HTML; prefer `<link rel="apple-touch-icon">`, then the largest `<link rel="icon" sizes=…>`, then `msapplication-TileImage`, and take the biggest square available (a 32px favicon upscaled to 87px is mush). Then CHECK IT AGAINST THE CARD: favicons are drawn for browser tabs and are usually a dark mark on transparency, which vanishes on a dark pass. When that happens, keep their glyph but set it on a filled disc in their brand colour with the mark knocked out in white — legible at 29px, and safe under Google's circular mask. WEB LINK: `webApp` is the business's site (a full https URL is fine) and `webAppLabel` is what Google Wallet calls that row. Without a label the row is named after the pass title, which tells the holder nothing about where it goes — write e.g. 'ACME website'. Omit `webApp` rather than guessing a URL; a row that leads nowhere is worse than no row. | |
| type | Yes | Pass type: loyalty, giftCard, eventTicket, offer, generic. | |
| beacons | No | Optional iBeacon configs. | |
| passPage | No | Optional pass landing-page design overrides. | |
| enableNFC | No | Enable NFC tap (default false). | |
| locations | No | Optional geofences that surface the pass on the lock screen near a site. Each entry: { name?, address?, latitude, longitude, relevantText? }. `latitude`/`longitude` (or `lat`/`lng`) are REQUIRED per entry — entries without a usable coordinate pair are dropped, since a geofence that cannot resolve never fires. `relevantText` is the lock-screen line, e.g. 'Hold your phone to the reader'. | |
| enrollForm | No | Optional enroll form. Shape: { title, buttonLabel, fields: [{ id, label, type, required, fieldValue? }] }. Form values route to issued passes by the same id/fieldValue rule as pass fields. | |
| cardSharing | No | Card sharing policy (Google Wallet). | |
| enableBarcode | No | Enable barcode (default true). | |
| requireAuthentication | No | Require device authentication to view the pass. |