Skip to content

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

ParameterTypeDescription
idstring (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:

FieldTypeDescription
namestringTemplate name
descriptionstringTemplate description
background_colorstring (hex)Background color
label_colorstring (hex)Label text color
value_colorstring (hex)Value text color
logo_textstringText shown with the logo
barcode_typestringOne of: none, qr, aztec, code128, pdf417
barcode_idstringField name for the barcode value
top_field_label / top_field_valuestringHeader field
front_fieldsarray<PassField>Primary fields (replaces existing)
secondary_fieldsarray<PassField>Secondary fields (replaces existing)
back_fieldsarray<PassField>Back-of-pass fields (replaces existing)
locationsarray<Location>Location triggers (replaces existing)
location_messagestringLocation notification message
tier_idstring (UUID)Tier identifier
tier_labelstringDisplay label for the tier
icon / logo / cover_imagestring (UUID) | nullFile IDs, or null to remove — see Template Images
ios_deeplink_id / ios_deeplink_urlnumber / stringiOS deeplink config

Example Request

bash
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)

json
{
  "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

typescript
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

StatusCodeDescription
400INVALID_PAYLOADInvalid field values
403FORBIDDENCaller is not a member of the template's workspace
404RECORD_NOT_FOUNDTemplate not found

WalletHero Documentation