# Cegid Retail Y2 APIs

This page lists the Cegid Retail Y2 services used by The Wallet Crew connector. It explains what each service does, why it matters, and which methods are called.

For connector setup, see [Connect with Cegid Retail Y2](/connectors/pos/cegid/connect-with-cegid-retail-y2.md). For customer field synchronization, see [Cegid Retail Y2 fields mapping](/connectors/pos/cegid/cegid-retail-y2-fields-mapping.md).

### At a glance

The Wallet Crew connects to Cegid Retail Y2 in real time through APIs and business notifications. Each service supports a specific wallet use case.

* **Customer** supports profile search, creation, update, and consent management. It is used to expose customer data in wallet journeys.
* **Cash Operations** exposes available vouchers and gift cards. It is used to display wallet benefits and stored value.
* **Loyalty** supports loyalty card creation and loyalty data retrieval, such as card details or points.
* **Sale Documents** exposes receipts and sales documents. It is used for receipt display and click-and-collect related journeys.
* **Business Notifications** sends events related to loyalty, purchase, or order activity. It is used to refresh wallet data and trigger push notifications in real time.

<details>

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

* A brand creates or updates a customer from an enrolment form. The Wallet Crew writes the profile back to Cegid Retail Y2.
* A loyalty card is created in Cegid Retail Y2, then displayed in Apple Wallet or Google Wallet with current balances or benefits.
* A recent purchase triggers receipt retrieval or PDF generation, so the document can be exposed in a wallet journey.

</details>

### How the integration works

The Wallet Crew uses two integration patterns with Cegid Retail Y2. Web service calls retrieve or update data on demand. Business notifications signal events that should trigger a refresh or a wallet notification.

In practice, customer and loyalty services support enrolment and card lifecycle. Cash operation and sales document services expose benefits and transaction data. The sales report endpoint generates receipt PDFs when a document file is needed.

### Services used by The Wallet Crew

#### Customer

The customer service supports profile lookup, creation, update, and consent synchronization. It is the foundation for account-linked wallet journeys.

**Endpoint:** `CustomerWcfService.svc`

**Methods used**

* `SearchCustomerIds` searches customer records, typically by email.
* `UpdateCustomer` updates an existing customer profile.
* `AddNewCustomer` creates a new customer in Cegid Retail Y2.

#### Cash Operations

The cash operations service exposes vouchers and gift cards attached to a customer. This makes stored value or available benefits available to wallet experiences.

**Endpoint:** `CashOperationsWcfService.svc`

**Methods used**

* `GetCustomerAvailableBons` retrieves available vouchers or gift cards for a customer.

#### Loyalty

The loyalty services manage loyalty cards and program data. They are used to create cards, retrieve card details, and determine which programs are available.

**Endpoints:** `LoyaltyWcfService.svc` and `LoyaltyEngineLoyaltyEngineService.svc`

**Methods used**

* `GetCustomerCards` returns loyalty cards linked to a customer.
* `GetLoyaltyCard` returns the details of a specific loyalty card.
* `CreateLoyaltyCard` creates a new loyalty card in Cegid Retail Y2.
* `GetCardCreationActiveProgramsOnStore` returns the loyalty programs available for a store.

#### Sale Documents

The sale document service provides access to transaction records. It is used for wallet use cases that depend on receipts or click-and-collect related documents.

**Endpoint:** `SaleDocumentService.svc`

**Methods used**

* `GetByKey` retrieves a specific sales document by key.
* `GetHeaderList` retrieves a list of recent sales documents.

#### Sales Report

The sales report service generates a receipt PDF. It is used when a rendered document is needed instead of raw sale document data.

**Endpoint:** `SalesExternalReport` (REST)

**Receipt PDF generation flow**

The receipt flow has three steps. First, `generatedocument` starts the PDF generation. Then `poll` checks whether the file is ready. Finally, `download` retrieves the generated PDF.

**Methods used**

* `generatedocument` starts a new PDF generation.
* `poll` checks whether the PDF is available.
* `download` downloads the generated PDF.

#### Employee

The employee service retrieves store staff data. It is mainly used when a wallet layout needs to display an advisor or salesperson.

**Endpoint:** `EmployeeSalespersonsService.svc`

**Methods used**

* `GetListDetail` returns the list of advisors for a store.

#### Business Notifications

Business notifications keep wallet data fresh without waiting for a manual refresh. They let The Wallet Crew react to events such as loyalty updates, purchases, or orders.

**Endpoint:** `BusinessNotificationSubscriptionService.svc`

**Methods used**

* `GetActive` lists active subscriptions.
* `Update` updates an existing subscription.
* `Create` creates a new subscription.
* `Delete` removes an existing subscription.

### Why these APIs matter

Together, these services let The Wallet Crew keep customer profiles, loyalty data, benefits, and transaction records aligned with Cegid Retail Y2. That alignment is what makes wallet passes feel current, reliable, and operationally useful.

### FAQ

<details>

<summary><strong>Does the connector rely only on notifications?</strong></summary>

No. The connector uses direct API calls to read and write data, and business notifications to react to events in near real time.

</details>

<details>

<summary><strong>Which service is used for vouchers and gift cards?</strong></summary>

`CashOperationsWcfService.svc` is used for that purpose through `GetCustomerAvailableBons`.

</details>

<details>

<summary><strong>Which service generates receipt PDFs?</strong></summary>

`SalesExternalReport` generates the PDF. `SaleDocumentService.svc` is used separately to retrieve sale document data and document lists.

</details>


---

# Agent Instructions: 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:

```
GET https://docs.thewalletcrew.io/connectors/pos/cegid/cegid-retail-y2-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
