Update Pass Template
Update an existing pass template. Changes are pushed to all passes using this template.
PATCH /wallethero-api/pass-templates/:id
Dedicated wallethero-api endpoint
This is an entity-guarded wallethero-api endpoint, not Directus /items/pass_templates/:id. The template is loaded by id and the caller's workspace membership is checked against its workspace_id. Server-managed columns (id, workspace_id, user_created, date_created, date_updated, statistics, passes) are stripped from the body.
Authentication
Bearer token — member of the template's workspace.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Template identifier |
Request Body
All fields are optional — only include the fields you want to change. Accepts any of the Create Pass Template fields except the audit/server-managed ones. Common ones:
| Field | Type | Description |
|---|---|---|
name | string | Template name |
description | string | Template description |
background_color | string (hex) | Background color |
label_color | string (hex) | Label text color |
value_color | string (hex) | Value text color |
logo_text | string | Text shown with the logo |
barcode_type | string | One of: none, qr, aztec, code128, pdf417 |
barcode_id | string | Field name for the barcode value |
top_field_label / top_field_value | string | Header field |
front_fields | array<PassField> | Primary fields (replaces existing) |
secondary_fields | array<PassField> | Secondary fields (replaces existing) |
back_fields | array<PassField> | Back-of-pass fields (replaces existing) |
locations | array<Location> | Location triggers (replaces existing) |
location_message | string | Location notification message |
tier_id | string (UUID) | Tier identifier |
tier_label | string | Display label for the tier |
icon / logo / cover_image | string (UUID) | null | File IDs, or null to remove — see Template Images |
ios_deeplink_id / ios_deeplink_url | number / string | iOS deeplink config |
Example Request
curl -X PATCH "https://api.wallethero.app/wallethero-api/pass-templates/TEMPLATE_ID" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"background_color": "#2d2d44",
"front_fields": [
{ "label": "Member", "value": "{{first_name}} {{last_name}}" },
{ "label": "Points", "value": "{{points}}" },
{ "label": "Status", "value": "{{tier}}" }
]
}'Response (200)
{
"data": {
"id": "template-uuid",
"name": "Gold Member Card",
"background_color": "#2d2d44",
"front_fields": [
{ "label": "Member", "value": "{{first_name}} {{last_name}}" },
{ "label": "Points", "value": "{{points}}" },
{ "label": "Status", "value": "{{tier}}" }
],
"date_updated": "2024-01-15T14:20:00Z",
"user_updated": "user-uuid"
}
}SDK Example
const updated = await wh.passTemplates.update("TEMPLATE_ID", {
background_color: "#2d2d44",
front_fields: [
{ label: "Member", value: "{{first_name}} {{last_name}}" },
{ label: "Points", value: "{{points}}" },
{ label: "Status", value: "{{tier}}" },
],
});
// Tier helpers (thin wrappers over update)
await wh.passTemplates.setTier("TEMPLATE_ID", "TIER_ID", "Gold");
await wh.passTemplates.removeTier("TEMPLATE_ID");
// iOS deeplink helpers (thin wrappers over update)
await wh.passTemplates.setIOSDeeplink("TEMPLATE_ID", {
ios_deeplink_id: 42,
ios_deeplink_url: "myapp://loyalty",
});
await wh.passTemplates.removeIOSDeeplink("TEMPLATE_ID");Important Notes
Pass updates
When you update a template, passes using it are refreshed the next time the user opens their wallet, a push notification is sent, or the pass is explicitly refreshed (see Refresh All Passes).
Template-level changes (colors, layout) affect all passes. Interpolated fields like only change when the underlying client data changes.
Errors
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_PAYLOAD | Invalid field values |
| 403 | FORBIDDEN | Caller is not a member of the template's workspace |
| 404 | RECORD_NOT_FOUND | Template not found |