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

Extensibility

Extend the Comarch connector with script hooks for customer, store and coupon mapping and pass installation write-back.

The default mapping covers the common loyalty fields. Use a script hook when the pass needs data that is not mapped by default, such as custom profile attributes, loyalty labels, extra location metadata, or project-specific field names. The complete reference of the Comarch scripts, with their registration, their handlers and worked examples, is the Comarch scripts page of the Developers guides.

Where custom mapping is configured

Scripts are added in the Advanced tab of Data & integrations → Connectors → CRM → Comarch.

Advanced tab of the Comarch settings editor, showing the script slots used for custom mapping
This is where the customer and store mapping scripts are added or reviewed.

Available hooks

The connector exposes four script hooks. All four are optional.

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

extensions.comarch.walletInstallationCustomerUpdater

Decide what changes on the Comarch customer when the pass is installed in or removed from a wallet

On every pass installation and removal, while Sync wallet attribute when a pass is added or removed is on

extensions.comarch.couponMapper

Adjust, or skip, the benefit each Comarch coupon becomes

For each coupon, at every pass creation and pass metadata update, while Sync Comarch coupons is on

What the hooks receive

The customer and store hooks receive 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.

Parameters, return values and examples of all four hooks: Comarch scripts.

The raw objects are also exposed for inspection under:

  • debug.comarch.customer

  • debug.comarch.store

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.

Last updated