> 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/crm-and-fidelity/comarch/extensibility.md).

# Extensibility

The default mapping covers the common loyalty fields. Extensibility is useful when a project needs extra Comarch attributes or a different pass payload shape.

## Where custom mapping is configured

Custom mapping is configured in the **Advanced** tab of the Comarch settings editor.

<figure><img src="/files/3FNitFij7RqMcCEYtLxx" alt=""><figcaption></figcaption></figure>

This is where connector scripts can be added to extend or override the default customer and store mapping.

{% hint style="info" %}
The Wallet Crew support can be contacted when custom mapping needs to be configured or reviewed.
{% endhint %}

## Available hooks

The connector exposes two script hooks.

| Hook                                | Purpose                             | When it runs                                                       |
| ----------------------------------- | ----------------------------------- | ------------------------------------------------------------------ |
| `extensions.comarch.customerMapper` | Extend or override customer mapping | After customer data is fetched and the standard mapping is applied |
| `extensions.comarch.locationMapper` | Extend or override store mapping    | After store data is fetched and the standard mapping is applied    |

## When to use extensibility

Use a custom hook when the pass needs data that is not mapped by default.

Common cases include custom profile attributes, loyalty labels, extra location metadata, or project-specific field names.

## What the hooks receive

Each hook receives the raw Comarch response and the pass entity.

This makes it possible to reuse any field present in the source payload, not only the default mapped fields.

The raw objects are also exposed for inspection under:

* `debug.comarch.customer`
* `debug.comarch.store`

## Recommended approach

Start with the default mapping first.

Then add only the extra fields that the pass really needs. This keeps templates simpler and reduces long-term maintenance.

## Safety notes

Apply mapping changes in staging first.

A mapping script can affect every pass refresh that uses the connector. Validation should cover both data correctness and template rendering.

## FAQ

<details>

<summary><strong>Where is custom Comarch mapping configured?</strong></summary>

Custom mapping is configured in the **Advanced** tab of the Comarch settings editor.

This is where connector scripts can be added to extend or override the default mapping.

</details>

<details>

<summary><strong>When should extensibility be used?</strong></summary>

Extensibility is useful when the default mapping does not cover the project needs.

Common cases include extra Comarch attributes, renamed fields, or project-specific transformation rules.

</details>

<details>

<summary><strong>Can extensibility change both customer and store mapping?</strong></summary>

Yes. Separate hooks are available for customer mapping and store mapping.

This makes it possible to adapt each part independently.

</details>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.thewalletcrew.io/connectors/crm-and-fidelity/comarch/extensibility.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
