> 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/pos/cegid/customer-data-and-loyalty/loyalty-cards-and-programmes.md).

# Loyalty cards and programmes

Create Cegid Retail Y2 loyalty cards and show programme names, points, stored value, and expiry on wallet passes.

The connector creates loyalty cards in Cegid Retail Y2 and reads card details, programme names, and point balances for wallet passes. This keeps Apple Wallet and Google Wallet loyalty passes aligned with Cegid data.

<details>

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

* A customer enrols at the till and receives a loyalty pass carrying their card number and current balance.
* A purchase adds points in Cegid, and the balance on the pass follows.
* A card is issued online with no store attached, using a configured default store.

</details>

### Creating a card

A loyalty card is created by adding the corresponding step to the enrolment flow, after the step that creates the customer. The card is created against the store the customer is being enrolled at, and the flow can be configured to ignore the store the end-user's session carries and use a fixed default instead, which is useful for online enrolment where no real store applies.

Two Cegid prerequisites decide whether creation succeeds. The store must belong to the relevant loyalty campaign, and it must be open. Where a closed store is used, the connector retries once against the configured default store before failing.

### Reading loyalty data

Cards attached to a customer are read on demand, filtered to those that are active and not closed. Where Cegid reports which programmes are available at the store, the list is further narrowed to cards belonging to those programmes, so that a card from an unrelated programme does not appear on a pass.

The following values are made available for pass templates.

| Field                                | Contains                                                      |
| ------------------------------------ | ------------------------------------------------------------- |
| `loyalty.programName`                | The name of the loyalty programme the card belongs to.        |
| `loyalty.points`                     | The point balance, with trailing zeros removed.               |
| `loyalty.activationDate`             | When the card was activated.                                  |
| `loyalty.expirationdate`             | When the card expires.                                        |
| `loyalty.amount`, `loyalty.currency` | Stored value, where the programme carries a monetary balance. |

{% hint style="warning" %}
`loyalty.expirationdate` is spelled entirely in lower case, unlike the fields around it. This is a known inconsistency; templates must use the spelling exactly as shown.
{% endhint %}

The card identifier itself is written onto the pass as `y2.loyaltyCardId`.

### When a card is deactivated

A pass carries the identifier of the loyalty card it represents. If that card is subsequently deactivated in Cegid, reads against it fail, and Cegid reports that the programme is not associated with a campaign defined for the store. That message is misleading, because the underlying cause is the card rather than the campaign.

The remedy is to clear the loyalty card identifier from the affected pass, so that the next read resolves the customer's current card instead.

### FAQ

<details>

<summary><strong>A new store cannot create loyalty cards. What is missing?</strong></summary>

The store is almost certainly absent from the Cegid loyalty campaign. Adding it there resolves it; no change is needed in The Wallet Crew.

</details>

<details>

<summary><strong>Why does a pass show no points immediately after a purchase?</strong></summary>

Either loyalty caching is holding a recent response, described in [Advanced configuration](/connectors/pos/cegid/setup-and-configuration/advanced-configuration.md), or the wallet has not yet requested an update. [Business notifications](/connectors/pos/cegid/events-and-operations/business-notifications.md) shorten the second delay.

</details>

<details>

<summary><strong>Can a customer hold several loyalty cards?</strong></summary>

Cegid permits it. The connector reads the active, non-closed cards and narrows them to programmes available at the store, so what appears on a pass depends on the programme configuration.

</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 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/pos/cegid/customer-data-and-loyalty/loyalty-cards-and-programmes.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.
