> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/connectors/ticketing/secutix/template-selection.md).

# Template selection

Route each Secutix ticket to the right pass template with a pass type finder hook, the WALLET comfort variable, subtype mapping or the default.

Every Secutix ticket that reaches The Wallet Crew must be rendered with a pass template configured in The Wallet Crew. **Template selection** is the routing logic that chooses that template per ticket.

It becomes useful as soon as one Event ticket template cannot cover all variants. Think VIP vs standard, season vs single-entry, different barcode formats, or different legal text.

<details>

<summary><strong>Real-world routing examples</strong></summary>

Common reasons to route tickets to different templates:

* **Different product types:** visit pass vs event ticket vs season ticket.
* **Different rooms / halls:** highlight the right room name and entry info.
* **Venue configuration changes:** seated, standing, in-the-round.
* **Numbered vs free placement:** show section/row/seat vs “free seating”.
* **Different access experiences:** VIP entrance, early access, staff-only gates.

</details>

## Mapping options

The connector resolves a template name for each ticket. It evaluates the rules below in order. **First match wins.**

### Resolution order (highest priority first)

1. Pass type finder hook.
2. Secutix comfort variable `WALLET`, on the operation (event), then on the product (vouchers and non-event products).
3. Product family subtype mapping.
4. Default template configured for the connector.

A resolved name that is not a configured pass type, including one returned by the hook, is logged as an error and replaced by the subtype or default mapping. The `WALLET` variable is then skipped. The resolved name must be an event ticket template.

### Pass type finder hook (advanced)

Use this when routing depends on any Secutix field(s). This is an advanced configuration. Treat it as a last resort and keep it rare because it adds custom logic to maintain. For variations that conditions and variables can express, see [Wallet pass template & field mapping](https://docs.thewalletcrew.io/connectors/ticketing/secutix/wallet-pass-template-and-field-mapping.md).

<details>

<summary><strong>Real-world use cases</strong></summary>

Use a hook when routing depends on more than one field:

* **Site / hall** - example: Hall A vs Hall B.
* **Entrance / gate** - different entry instructions.
* **Seat category / zone** - VIP, hospitality, balcony.
* **Performance date/time** - matinee vs evening, special dates.
* **Combined logic** - VIP + a specific date + a specific venue.

</details>

Add a custom script in the **Advanced** tab → **Ticket pass template** of the Secutix settings.

<p align="center"><a href="https://admin.thewalletcrew.io/tenant/~/integrations/secutix/settings" class="button secondary" data-icon="chevrons-right">Open Secutix settings</a></p>

<details>

<summary><code>passTypeFinder</code> extensibility endpoint</summary>

Register `extensions.secutix.ticket.passTypeFinder` and implement `GetPassType`.

* Return a string to force a template name.
* Return `null` to fall back to default selection.

Scripts receive the Secutix objects with their PascalCase property names, for example `operationData.Site` or `product.Code`.

The complete contract and a code sample are in [Secutix scripts](https://docs.thewalletcrew.io/developers-guides/scripting/extensions/secutix.md).

</details>

### `WALLET` comfort variable

Add a Secutix comfort variable on the targeted event named `WALLET` (written in capitals by convention; the name is compared case-insensitively). The value is the first non-empty translation of the variable. Set its value to **the exact template name in The Wallet Crew**. This value is **case-sensitive**, so `VIP_Template` is not the same as `vip_template`. Avoid leading or trailing spaces.

{% hint style="info" %}
Use this when a special template is needed for one event. Keep template names stable. Renaming a template can break routing.
{% endhint %}

### Product family subtype mapping

This is the default routing mode when no hook or `WALLET` override is used. Each product family subtype has its own optional key under `pass.defaultPassTypes` in `server/secutix.yml`: MEMBERSHIP `membership`, SEASONTICKET `seasonticket`, SIMPLE\_TICKET `event`, SPORTING\_EVENT `match`, VISIT\_PASS `visitPass`, OPEN\_PASS `openPass`, OPEN `openProduct`, VOUCHER `voucher`, DONATION `donation`, SERVICE `service`. The value of a key is the template name. A subtype with no value, or any other subtype, uses `default`, which is required.

The connector reads the ticket’s **product family subtype**, then translates it into a template name in The Wallet Crew.

<div data-with-frame="true"><figure><img src="https://3852727835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlP7d71aYydav6e0pRkxc%2Fuploads%2Fgit-blob-e59b5b038054a74d27e4b0b2c9a4b8145407a1d3%2Fconnect-selection-selection-based-product-family-subtype.png?alt=media" alt="Template selection based on product family subtype." width="563"><figcaption><p>Template selection based on product family subtype.</p></figcaption></figure></div>

### Connector default template

The connector **Default** template is the safety net. Keep it compatible with most tickets.

## Additional information

For a quick refresher on how The Wallet Crew templates are structured, start with [Pass types & templates](https://docs.thewalletcrew.io/guides-design/design/pass-types-and-templates.md). To create or adjust the Event ticket template (and map Secutix fields into it), use [Wallet pass template & field mapping](https://docs.thewalletcrew.io/connectors/ticketing/secutix/wallet-pass-template-and-field-mapping.md).

Once routing is clear, implement the end-user flows in [Distribution](https://docs.thewalletcrew.io/connectors/ticketing/secutix/distribution.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.thewalletcrew.io/connectors/ticketing/secutix/template-selection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
