Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
ReferenceWallet

Liquid templating

Use Liquid templating in The Wallet Crew to render dynamic pass fields, format values and build Apple Wallet and Google Wallet pass content.

Liquid combines fixed text with dynamic values from a pass. The Wallet Crew uses the DotLiquid implementation, plus custom date filters and the minify tag.

Confirm available data

Each render receives a data context. It can contain pass data, additional data, and values returned by connected providers.

Inspect View data on a real pass before writing a template. This payload is the source of truth for variable paths.

Additional data is suitable for visible pass content.

For the complete update and validation flow, see Update pass data in templates.

Common paths include:

Data
Example paths

Customer

firstName, lastName, address.city

Pass

serialNumber, tenantId, publicUrl, authenticationToken

Loyalty

loyalty.points, pendingLoyaltyPoints, loyalty.amounts

Gift card

voucher.amount, voucher.currency, id.y2.giftCardId

Event ticket

ticket.name, ticket.startDate, ticket.seatNumber, ticket.entrance

Collections

y2.tickets, y2.bons.loyaltyCertificates

Custom values

additionalData.<key>

The y2.* and id.y2.* paths come from the Cegid Y2 connector. They exist only on tenants that use it.

Missing values render as an empty string. Use default when a visible fallback is required. default prevents a blank balance. floor prevents unwanted decimal points.

{{ loyalty.points | default: 0 | floor }}

Benefits on a pass

Pass templates can display benefit data in their fields with Liquid. Each benefit is available under benefits.<template key>, where the key is the benefit template identifier with every character other than a letter, a digit or an underscore replaced by _. Counters are available under benefitStats.

Variable
Value

{{ benefits.free_drink_reward.data.value }}

The balance of the benefit granted from the template free-drink-reward.

{{ benefitStats.total }}

Benefits on the pass, removed ones excluded.

{{ benefitStats.active }}

Benefits usable now.

{{ benefitStats.scheduled }}, {{ benefitStats.used }}, {{ benefitStats.expired }}

Benefits not active yet, used, or expired.

Syntax basics

Use {{ ... }} to print a value. Use {% ... %} for logic that does not print on its own.

Filters run left to right. Dot notation follows the nested structure in the data payload.

Conditions and loops

Liquid treats only nil and false as falsy. The number 0 and the string "false" are truthy. Compare optional numbers explicitly.

Guard loops with a collection-size check. This prevents empty section headings.

Inside a loop, forloop.index, forloop.first, forloop.last, and forloop.length are available.

Assignments, branches, and whitespace

Use assign to reuse calculated values. Use case for code-to-label mappings.

Use {%- and -%} to trim surrounding whitespace. This keeps multi-line templates compact in narrow wallet fields.

YAML values

Quote Liquid values containing YAML special characters (:, {, #, &). Use |- for multi-line values.

Custom filters

Date filters

All date filters parse the input as a date or time value, apply the operation, and return a DateTimeOffset. Chain them with | date: "format" when a string output is needed.

Filter
Adds
Example

add_seconds

seconds

{{ someDate | add_seconds: 3600 }}

add_minutes

minutes

{{ someDate | add_minutes: 60 }}

add_hours

hours

{{ someDate | add_hours: 24 }}

add_days

days

{{ someDate | add_days: 7 }}

add_timespan

a timespan in hh:mm:ss format

{{ someDate | add_timespan: "02:30:00" }}

Chain a date filter with date to format the result, for example:

These filters read their argument (a number or a timespan) in invariant culture. They do not format the date: the date filter does, in the pass locale.

Format filter

format

Applies a format string to any IFormattable value such as numbers, dates, and enums.

This renders a grouped integer such as 1,234 in invariant culture.

This renders a currency-style value with two decimals.

Custom tag

minify

Generates a short redirect URL from a rendered pass link.

The tag first renders the nested expression, then creates a short URL through The Wallet Crew redirect service, and finally outputs the shortened URL string.

Standard filters

Standard DotLiquid filters transform strings, numbers, dates, and collections.

Strings

Filter
Example

default

{{ loyalty.points | default: 0 }}

upcase, downcase, capitalize

{{ firstName | capitalize }}

strip, lstrip, rstrip

{{ ticket.name | strip }}

append, prepend

{{ publicUrl | append: tenantId }}

replace, remove

{{ ticket.name | replace: "VIP", "Premium" }}

truncate, truncatewords, slice

{{ id.y2.customerId | slice: 0, 4 }}

split

{{ "a,b,c" | split: "," }}

Use an empty truncation suffix to create an initial:

Numbers and collections

Filter
Example

floor, ceil, round

{{ loyalty.points | default: 0 | floor }}

plus, minus, times, divided_by, modulo

{{ loyalty.points | divided_by: 100 | floor }}

abs, at_least, at_most

{{ balance | at_least: 0 }}

size, first, last, join

{{ tags | join: ", " }}

sort, reverse, uniq, compact

{{ items | sort | reverse }}

map, where

{{ y2.tickets | map: "ticketNumber" | join: ", " }}

Dates, URLs, and HTML

The date filter formats date values for the pass locale.

Expression
Typical output

{{ ticket.startDate | date: "D" }}

Wednesday, 27 May 2026

{{ ticket.startDate | date: "d" }}

27/05/2026

{{ ticket.startDate | date: "M" }}

27 May

{{ ticket.startDate | date: "t" }}

20:00

{{ ticket.startDate | date: "yyyy-MM-dd HH:mm" }}

2026-05-27 20:00

Use url_encode and url_decode for URL values. Use escape, escape_once, or strip_html for HTML email values.

For the complete filter list, see the DotLiquid reference.

Recipes

The following patterns solve common loyalty, gift-card, and event-ticket needs. Confirm all data paths before use.

Loyalty cards

Show pending points separately

Only render the pending line when points await validation.

Create a repeating stamp counter

modulo resets the visible counter after each reward.

The same pattern can select a matching image:

Show progress to the next reward

Calculate the remaining points from an editable threshold.

Derive a tier name

This pattern works when the source provides only a points balance.

List available vouchers

Render vouchers on the back of the card. An else branch makes the empty state clear.

Gift cards

Reuse one identifier

Use the same value for the barcode and manual-entry fields.

Display a variable amount

This uses an optional gift amount and a safe fallback.

Keep amount and currency separate

Dedicated fields let wallet platforms apply local currency formatting.

Set the validity window

Use the source dates for expiry and relevance.

Event tickets

Expire after the event

Expiry on the following day avoids time-zone and late-arrival issues. expirationDate expects an ISO 8601 date, so format it as one. The date: "d" format outputs a locale short date such as 28/05/2026.

Set a relevance window

This helps wallet platforms surface the ticket at the right time.

Display the event date and time

Separate fields allow the wallet layout to prioritize date or time.

Map category codes

case converts source codes into readable, locale-specific labels.

Build venue directions

Clean optional fields before concatenating them. Whitespace control keeps the output compact.

List tickets on a multi-ticket pass

This is useful for grouped purchases and multi-event passes.

Create an authenticated deep link

Only use this pattern where the destination supports the pass authentication flow.

The neo. prefix of neo.authToken comes from neostore, the platform's former name, and is kept in technical identifiers.

Validate and troubleshoot templates

A date is shifted or formatted unexpectedly

Dates contain time-zone information. Format the intended output explicitly. Use add_hours only when a known offset is required.

format ignores the pass locale

This is expected. format uses invariant culture. Use date for locale-aware dates. Assemble locale-specific number or currency text in each locale file when needed.

Literal Liquid syntax is required

Use raw and endraw.

The template contains a syntax error

Invalid Liquid can render an error message instead of the intended value. Treat parse errors as template defects and fix them before publication.

Use the pass preview in the admin console to test Liquid expressions against real pass data before deploying a template change to production.

For render timing and failure handling outside Liquid itself, see How a pass is rendered.

FAQ

Is Shopify Liquid fully supported?

No. The Wallet Crew uses DotLiquid plus the custom extensions documented on this page. Shopify-specific extensions should not be assumed to work unless they are documented here.

Last updated