How the Cegid Retail Y2 connector works
Understand how the Cegid Retail Y2 connector exchanges customer, loyalty, voucher and sales data with The Wallet Crew to keep wallet passes up to date.
Two principles explain the connector's behavior: Cegid remains the system of record, and the connector reads data on demand.
Cegid holds the data, The Wallet Crew holds the pass
The connector does not act as a separate Cegid customer database. When an enrolment form is submitted, the profile is written to Cegid Retail Y2 and then read back. When a pass is rendered, its customer, loyalty, and voucher data is retrieved from Cegid. The Wallet Crew retains the pass and identifiers needed to link it to the related Cegid record.
The two directions of traffic
Data moves between the two systems in two quite different ways, and confusing them is a common source of misunderstanding.
Outbound calls carry almost all of the traffic. The connector calls the Y2 web services to search for a customer, create or update a profile, create a loyalty card, list vouchers, or fetch a sales document. These calls happen when a form is submitted and again whenever a pass is built. Because Apple Wallet and Google Wallet poll for pass updates on their own schedule, a single customer can generate many reads over a day, which is why caching and rate limiting exist. Both are covered in Advanced configuration.
Inbound business notifications are optional and carry very little data. Cegid can be configured to notify The Wallet Crew when a customer is created or updated, a receipt is created, or a loyalty card operation occurs. The notification carries identifiers, not content: the connector reacts by reading the affected record back from Cegid and refreshing the relevant passes.
What ends up on a pass
When the connector resolves a customer, it writes a small set of identifiers onto the pass so that later reads can go straight to the right Cegid record instead of searching again. The Cegid customer identifier is stored as id.y2.customerId, and a linked loyalty card as id.y2.loyaltyCardId. Gift cards, certificates, and deposits each get their own identifier in the same family.
Loyalty values are exposed for use in pass templates under a loyalty. prefix: the program name, activation and expiration dates, the point balance, and for stored-value products an amount and currency.
The moving parts
Three kinds of component make up the connector, and tenant configuration refers to them by name.
Customer providers read from Cegid when a pass or form needs data. The y2 provider fetches the customer profile, y2.loyalty fetches loyalty cards, y2.customerCashOperations and y2.cashOperations fetch vouchers and stored value, and y2.tickets fetches sales documents.
Flow elements are the steps in an enrolment or update flow that write to Cegid. The y2Customer step creates or updates the profile, y2Loyalty creates a loyalty card, y2PendingTicket raises a held receipt, and y2ExecuteScheduledTask triggers a Cegid scheduled task.
Scheduled work runs on its own timetable. The cegid.newOrderWalletUpdate task refreshes passes affected by recent orders. It is described in Receipts, vouchers, and sales documents. The Cegid flow steps and their options are described in Loyalty cards and programmes (y2Loyalty) and Receipts, vouchers, and sales documents (y2PendingTicket and y2ExecuteScheduledTask).
Last updated

