> 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/livestore.md).

# Cegid Retail Live Store

Enable the Cegid Retail Live Store customer form so store teams can create or edit customers through The Wallet Crew enrolment flows.

Cegid Retail Live Store (Live Store) is Cegid's point-of-sale application. Its external customer form opens an enrolment flow of The Wallet Crew when store teams create or edit a customer. The flow then returns them to the customer record. A code can also support self-service enrolment from a customer's phone.

<details>

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

* A store staff member creates a customer in Live Store; the enrolment form of The Wallet Crew collects the data and the profile is created in Cegid, with a pass issued immediately.
* A store staff member edits an existing customer and the form opens pre-filled from Cegid.
* A store runs a tablet at the entrance and customers complete enrolment on their own phone via a displayed code.

</details>

## Prerequisites

Live Store enrolment writes through the Cegid Retail Y2 connector by default (`provider: y2`), or through the [Cegid UR](https://docs.thewalletcrew.io/connectors/pos/cegid/cegid-ur.md) connector (`provider: ur`). That connector must already be configured and working. For Y2, start with [Configure the Cegid Retail Y2 connector](https://docs.thewalletcrew.io/connectors/pos/cegid/setup-and-configuration/connect-with-cegid-retail-y2.md), and check which customer fields are synchronized in [Cegid Retail Y2 fields mapping](https://docs.thewalletcrew.io/connectors/pos/cegid/customer-data-and-loyalty/cegid-retail-y2-fields-mapping.md).

On the Cegid side, permission to edit the point-of-sale settings at global, country, or store level is required.

## Configure The Wallet Crew

Four things are needed, none of which is on the Cegid configuration page.

{% stepper %}
{% step %}

#### Create an API key

Create an API key for Live Store to call The Wallet Crew with. It must carry the scope `tenant.livestore.access:write`. Copy the generated value and store it in a secret manager; it is used as the `X-API-KEY` header in the Live Store configuration.

{% hint style="danger" %}
A key without `tenant.livestore.access:write` will not work.
{% endhint %}
{% endstep %}

{% step %}

#### Add the account challenger

In the security configuration (`security.yml`), add an account challenger of the `livestore` type. This is what allows a Live Store session to identify the customer being edited.

Do not use the `none` check-in policy with Live Store.
{% endstep %}

{% step %}

#### Add the flow element

Add a `livestore` flow element to the enrolment flow. It handles the return to Cegid after submission.
{% endstep %}

{% step %}

#### Create the Live Store configuration

Create `server/livestore.yml`, naming the layout to display, whether tablet mode is in use, the layout to redirect to in tablet mode, and whether the customer provider is Y2 or UR.

```yaml
layout: mobile_ls
useTabletMode: false
provider: y2
customerRedirectLayout: mobile_livestore
```

A layout is an enrolment page of the tenant, served at `https://app.thewalletcrew.io/{tenantId}/{layout}`. `layout` names the page Live Store opens. `customerRedirectLayout` names the page the customer's phone is redirected to in tablet mode. The layout names in the examples are illustrative: use the names of the tenant's own layouts, and create or update both referenced layouts. The tablet-mode example below uses other names because tablet mode shows a code and redirects to a mobile layout.
{% endstep %}
{% endstepper %}

## Configure Live Store

The extension is configured in the Live Store point-of-sale settings, at **global, country, or store level**. It is not available at register level.

<figure><img src="https://3852727835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlP7d71aYydav6e0pRkxc%2Fuploads%2Fgit-blob-9f0ec5a2400496e78d2ed2ae1ea7a63e1d42ad0b%2Fdocumentation-livestore-cegid-newpossettings-scope-selection-showing-global-country.png?alt=media" alt="The Cegid point-of-sale settings scope selector, showing the global, country, and store levels."><figcaption><p>Choose the scope at which the extension applies.</p></figcaption></figure>

Two addresses are entered: one that Live Store calls to open a session, and one that the store staff member's browser is redirected to. Both are tenant-specific, and both differ between the production and staging environments (see [Environments and URLs](https://docs.thewalletcrew.io/connectors/marketing-automation.md#environments-and-urls) for the hosts). Replace `{tenantId}` with the tenant identifier.

| Address                                               | Production                                                               | Staging                                                                     |
| ----------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------- |
| Session (called by Live Store with `POST`)            | `https://api.thewalletcrew.io/api/{tenantId}/external/livestore/session` | `https://api-qa.thewalletcrew.io/api/{tenantId}/external/livestore/session` |
| Redirect (opened in the store staff member's browser) | `https://app.thewalletcrew.io/api/{tenantId}/external/livestore`         | `https://app-qa.thewalletcrew.io/api/{tenantId}/external/livestore`         |

{% hint style="warning" %}
Using a staging key against a production address, or the reverse, produces a form that fails to load. Use separate keys per environment: it makes this easier to diagnose and allows one to be revoked without affecting the other.
{% endhint %}

Where a single store should be pinned, the store identifier is appended to the address as the `storeId` parameter (for example `?storeId=530`). When the session call carries a `storeId`, it replaces the store sent in the session body.

## How the session works

Live Store opens a session by calling The Wallet Crew with its API key, supplying a session identifier it chooses, the customer being edited and a return address. The Wallet Crew holds that context for one hour. Opening the session again with the same identifier replaces the customer and restarts the hour. Live Store then redirects the store staff member's browser to the enrolment form, carrying that identifier.

```mermaid
sequenceDiagram
  autonumber
  participant LS as Live Store
  participant Browser as Store staff member's browser
  participant TWC as The Wallet Crew
  participant Y2 as Cegid Retail Y2

  LS->>TWC: Open session (API key, session identifier, customer context, return address)
  Note over LS,TWC: The API key is used on this hop only
  TWC-->>LS: Session stored, valid one hour

  LS->>Browser: Redirect to enrolment form (session identifier only)
  Browser->>TWC: Open enrolment form
  TWC-->>Browser: Form, pre-filled from the session context

  Browser->>TWC: Submit enrolment
  TWC->>Y2: Write customer data
  TWC-->>Browser: Redirect to the return address
  Browser->>LS: Back on the customer record
  LS->>Y2: Read customer data
```

{% hint style="danger" %}
The form address contains a short-lived session identifier. Treat it as a credential: do not share, log, or bookmark an address that contains one.
{% endhint %}

After submission the store staff member is returned to the customer record in Live Store. The Wallet Crew does not write back into Live Store itself; the customer data is written to Cegid Retail Y2, which Live Store reads from.

## Self-service enrolment on a tablet

Where a store uses a tablet rather than a till screen, tablet mode displays a code the customer scans to continue enrolment on their own phone. It is enabled in the Live Store configuration, together with the mobile layout to redirect to.

```yaml
layout: pos
useTabletMode: true
provider: y2
customerRedirectLayout: mobile
```

## Validate the flow

1. Validate in a test environment first, with test keys and test addresses.
2. Open the customer create or edit screen in Live Store and confirm it redirects to the enrolment form.
3. Submit the form with test data.
4. Confirm the return to the Live Store customer record, and the record in Cegid.

## FAQ

<details>

<summary><strong>The form opens but shows nothing. What should be checked?</strong></summary>

Check, in this order: the API key matches the environment of the address, the key carries `tenant.livestore.access:write`, and the account challenger is configured.

</details>

<details>

<summary><strong>Live Store redirects but the flow ends on an error page. What should be checked?</strong></summary>

Confirm the address is reachable from the Live Store network, that the `X-API-KEY` header is present and correct, and that the Cegid Retail Y2 connector is configured and can reach the Y2 services.

</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/livestore.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.
