> 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/api-reference/advanced/cegid-y2.md).

# Cegid Y2

## Get the Cegid Y2 configuration

> Passwords are never returned; each connection carries \`hasPassword\`, and its business notification\
> credentials \`hasPassword\`, so callers can tell whether one is stored.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"CegidY2"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.y2.settings:read"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CegidY2ConfigurationResponse":{"required":["connections","rateLimit","updateCustomerOnPassInstallationChange"],"type":"object","properties":{"connections":{"type":"array","items":{"description":"One Y2 server connection, in the Cegid Y2 GET response body.","$ref":"#/components/schemas/CegidY2ConnectionResponse"},"description":"Y2 server connections, in the stored order, without their passwords."},"updateCustomerOnPassInstallationChange":{"type":"boolean","description":"Whether the Y2 customer is updated when the holder installs the pass on a first device or removes it from\nthe last one."},"cache":{"description":"Cache durations of the Y2 lookups. Null when no cache settings are stored, which disables caching.","$ref":"#/components/schemas/CegidY2CacheSettings"},"rateLimit":{"description":"Client-side rate limiting; the defaults when none are stored.","$ref":"#/components/schemas/CegidY2RateLimitSettings"}},"additionalProperties":false,"description":"Response body for the Cegid Y2 configuration."},"CegidY2ConnectionResponse":{"required":["databaseId","hasPassword","isDefault","listenToBusinessNotification","name","serviceUrl","userName"],"type":"object","properties":{"name":{"minLength":1,"type":"string","description":"Identifies the connection: stores select it through their `y2.connectionName` property or by having\na store id equal to it, and it ends the business notification URL."},"isDefault":{"type":"boolean","description":"Whether this connection serves the calls no store maps to another connection, including every call made\noutside a store context."},"serviceUrl":{"minLength":1,"type":"string","description":"Base URL of the Y2 services, always with a trailing `/`."},"userName":{"minLength":1,"type":"string","description":"Y2 user the integration calls Y2 with."},"hasPassword":{"type":"boolean","description":"Whether a non-blank password is stored for Neo.Extensions.Cegid.Controllers.CegidY2ConnectionResponse.UserName. The password itself is never returned;\nomit it on the PUT to keep it."},"databaseId":{"minLength":1,"type":"string","description":"Y2 database (folder) the calls target."},"listenToBusinessNotification":{"type":"boolean","description":"Whether Y2 pushes its business notifications to this platform for this connection, so the holders' passes\nfollow customer, receipt and loyalty card changes."},"businessNotificationSettings":{"description":"Business notification settings. Null when none are stored.","$ref":"#/components/schemas/CegidY2BusinessNotificationSettingsResponse"},"receiptSettings":{"description":"How the receipt PDFs of this connection are rendered. Null when none are stored.","$ref":"#/components/schemas/CegidY2ReceiptSettings"}},"additionalProperties":false,"description":"One Y2 server connection, in the Cegid Y2 GET response body."},"CegidY2BusinessNotificationSettingsResponse":{"type":"object","properties":{"webServiceCredentials":{"description":"Business notification user (BNU) the subscription is managed with. Null when none is stored.","$ref":"#/components/schemas/CegidY2WebServiceCredentialsResponse"}},"additionalProperties":false,"description":"Business notification settings of a connection, in the Cegid Y2 GET response body."},"CegidY2WebServiceCredentialsResponse":{"required":["hasPassword","userName"],"type":"object","properties":{"userName":{"minLength":1,"type":"string","description":"Y2 user the business notification subscription is read, created and updated with."},"hasPassword":{"type":"boolean","description":"Whether a non-blank password is stored for the business notification user. The password itself is never\nreturned; omit it on the PUT to keep it."}},"additionalProperties":false,"description":"Business notification user credentials of a connection, in the Cegid Y2 GET response body."},"CegidY2ReceiptSettings":{"type":"object","properties":{"templateId":{"type":["null","string"],"description":"Y2 report template the receipt PDF is rendered with, e.g. `ZDE`."},"duplicate":{"type":"boolean","description":"Whether Y2 renders the receipt PDF as a duplicate rather than as the original. Default false.","default":false}},"additionalProperties":false,"description":"Receipt settings of a connection, shared between the Cegid Y2 request and response bodies."},"CegidY2CacheSettings":{"type":"object","properties":{"customer":{"type":["null","string"],"description":"Reuse of a Y2 customer read by its customer id.","format":"date-span"},"loyalty":{"type":["null","string"],"description":"Reuse of the loyalty card reads: a customer's cards, and one card by its id.","format":"date-span"},"saleDocuments":{"type":["null","string"],"description":"Reuse of the sale document reads: a customer's sale document list, and one sale document by its key.","format":"date-span"},"cashOperations":{"type":["null","string"],"description":"Reuse of the cash operation reads: a customer's vouchers (bons), and the available amount of one voucher.","format":"date-span"}},"additionalProperties":false,"description":"How long Y2 answers are reused before Y2 is asked again, shared between the Cegid Y2 request and response\nbodies. Durations are `d.hh:mm:ss` strings, e.g. `00:05:00`; a null or zero duration does not cache\nthat lookup."},"CegidY2RateLimitSettings":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether calls are counted and limited. When false, calls go to Y2 unthrottled on this side. Default true.","default":true},"permitLimit":{"maximum":2147483647,"minimum":1,"type":"integer","description":"Maximum number of calls per window, at least 1. Default 4980. Cegid allows 5000 per 5 minutes on the\nAdvance plan, 20000 on the Dedicated plan.","format":"int32","default":4980},"windowSeconds":{"maximum":2147483647,"minimum":1,"type":"integer","description":"Length of the window Neo.Extensions.Cegid.Controllers.CegidY2RateLimitSettings.PermitLimit applies to, in seconds, at least 1. Default 300, Cegid's\nown window.","format":"int32","default":300},"retryAfterSeconds":{"maximum":2147483647,"minimum":0,"type":"integer","description":"Delay, in seconds, before a throttled call is tried again, used when Cegid's `Retry-After` header\nsupplies none. At least 0, default 60.","format":"int32","default":60},"queueAcquireTimeoutSeconds":{"maximum":2147483647,"minimum":0,"type":"integer","description":"Maximum time, in seconds, a call over the limit waits for a slot before failing. Default 0: such a call\nfails at once.","format":"int32","default":0},"queueRetryDelaySeconds":{"maximum":2147483647,"minimum":1,"type":"integer","description":"Interval, in seconds, at which a waiting call checks for a free slot, at least 1. Default 1. Used only when\nNeo.Extensions.Cegid.Controllers.CegidY2RateLimitSettings.QueueAcquireTimeoutSeconds is above 0.","format":"int32","default":1}},"additionalProperties":false,"description":"Client-side rate limiting of the calls to Y2, shared between the Cegid Y2 request and response bodies. Keeps\nthe calls to Y2 under the quota of the tenant's Cegid plan."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/extensions/cegid/y2":{"get":{"tags":["CegidY2"],"summary":"Get the Cegid Y2 configuration","description":"Passwords are never returned; each connection carries `hasPassword`, and its business notification\ncredentials `hasPassword`, so callers can tell whether one is stored.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Configuration returned.","content":{"text/plain":{"schema":{"description":"Response body for the Cegid Y2 configuration.","$ref":"#/components/schemas/CegidY2ConfigurationResponse"}},"application/json":{"schema":{"description":"Response body for the Cegid Y2 configuration.","$ref":"#/components/schemas/CegidY2ConfigurationResponse"}},"text/json":{"schema":{"description":"Response body for the Cegid Y2 configuration.","$ref":"#/components/schemas/CegidY2ConfigurationResponse"}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the <c>tenant.y2.settings:read</c> scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"Cegid Y2 is not configured for this tenant.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after <c>Retry-After</c>.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Set the Cegid Y2 configuration

> Creates or replaces the Cegid Y2 configuration; \`connections\` is the complete list.\
> Passwords are matched to the stored connections by \`name\`: omit \`password\`, or\
> \`businessNotificationSettings.webServiceCredentials.password\`, to keep the one stored for the\
> connection of the same name. Renaming a connection therefore requires its passwords again.\
> When \`updateCustomerOnPassInstallationChange\`, \`cache\` or \`rateLimit\` is omitted, the stored\
> value is kept; send \`cache\` without durations to disable caching.\
> Saving registers the Y2 business notification subscription of every connection with\
> \`listenToBusinessNotification\`, which disables any other active subscription on that Y2 database.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"CegidY2"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.y2.settings:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"SetCegidY2Request":{"required":["connections"],"type":"object","properties":{"connections":{"minItems":1,"type":"array","items":{"description":"One Y2 server connection, in the Cegid Y2 PUT request body.","$ref":"#/components/schemas/CegidY2ConnectionRequest"},"description":"The complete list of Y2 server connections, at least one: a stored connection left out is removed. Names\nare unique and exactly one connection is the default, refused with 400 otherwise."},"updateCustomerOnPassInstallationChange":{"type":["null","boolean"],"description":"Whether the Y2 customer is updated when the holder installs the pass on a first device or removes it from\nthe last one, so Y2 records whether the holder carries the pass. Omitted, the stored value is kept, or\ntrue when none is stored."},"cache":{"description":"Cache durations of the Y2 lookups. Omitted, the stored ones are kept; sent without durations, caching is\ndisabled.","$ref":"#/components/schemas/CegidY2CacheSettings"},"rateLimit":{"description":"Client-side rate limiting. Omitted, the stored settings are kept, or the defaults when none are stored.","$ref":"#/components/schemas/CegidY2RateLimitSettings"}},"additionalProperties":false,"description":"Request body for setting the Cegid Y2 configuration."},"CegidY2ConnectionRequest":{"required":["databaseId","name","serviceUrl","userName"],"type":"object","properties":{"name":{"minLength":1,"type":"string","description":"Identifies the connection. Unique within the request (compared case-sensitively), refused with 400 when\nrepeated."},"isDefault":{"type":"boolean","description":"Whether this connection serves the calls no store maps to another connection, including every call made\noutside a store context. Exactly one connection is the default, refused with 400 otherwise. Default false.","default":false},"serviceUrl":{"minLength":1,"type":"string","description":"Base URL of the Y2 services. A trailing `/` is added when missing."},"userName":{"minLength":1,"type":"string","description":"Y2 user the integration calls Y2 with."},"password":{"type":["null","string"],"description":"Password of Neo.Extensions.Cegid.Controllers.CegidY2ConnectionRequest.UserName. Omitted or blank, the password stored for the connection of the same\n`name` is kept; refused with 400 when none is stored."},"databaseId":{"minLength":1,"type":"string","description":"Y2 database (folder) the calls target."},"listenToBusinessNotification":{"type":"boolean","description":"Whether Y2 pushes its business notifications (customer, receipt and loyalty card changes) to this platform,\nso the holders' passes follow them. Default false.","default":false},"businessNotificationSettings":{"description":"Business notification settings. Required, with `webServiceCredentials`, when\nNeo.Extensions.Cegid.Controllers.CegidY2ConnectionRequest.ListenToBusinessNotification is true; refused with 400 otherwise.","$ref":"#/components/schemas/CegidY2BusinessNotificationSettingsRequest"},"receiptSettings":{"description":"How the receipt PDFs of this connection are rendered. Null leaves receipt PDFs to the stores'\n`y2.receiptTemplateId` property.","$ref":"#/components/schemas/CegidY2ReceiptSettings"}},"additionalProperties":false,"description":"One Y2 server connection, in the Cegid Y2 PUT request body."},"CegidY2BusinessNotificationSettingsRequest":{"type":"object","properties":{"webServiceCredentials":{"description":"Business notification user (BNU) the subscription is managed with. Required when the connection's\n`listenToBusinessNotification` is true; refused with 400 otherwise.","$ref":"#/components/schemas/CegidY2WebServiceCredentialsRequest"}},"additionalProperties":false,"description":"Business notification settings of a connection, in the Cegid Y2 PUT request body."},"CegidY2WebServiceCredentialsRequest":{"required":["userName"],"type":"object","properties":{"userName":{"minLength":1,"type":"string","description":"Y2 user the business notification subscription is read, created and updated with."},"password":{"type":["null","string"],"description":"Password of the business notification user. Omitted or blank, the password stored for the connection of\nthe same `name` is kept; refused with 400 when none is stored."}},"additionalProperties":false,"description":"Business notification user credentials of a connection, in the Cegid Y2 PUT request body."},"CegidY2ReceiptSettings":{"type":"object","properties":{"templateId":{"type":["null","string"],"description":"Y2 report template the receipt PDF is rendered with, e.g. `ZDE`."},"duplicate":{"type":"boolean","description":"Whether Y2 renders the receipt PDF as a duplicate rather than as the original. Default false.","default":false}},"additionalProperties":false,"description":"Receipt settings of a connection, shared between the Cegid Y2 request and response bodies."},"CegidY2CacheSettings":{"type":"object","properties":{"customer":{"type":["null","string"],"description":"Reuse of a Y2 customer read by its customer id.","format":"date-span"},"loyalty":{"type":["null","string"],"description":"Reuse of the loyalty card reads: a customer's cards, and one card by its id.","format":"date-span"},"saleDocuments":{"type":["null","string"],"description":"Reuse of the sale document reads: a customer's sale document list, and one sale document by its key.","format":"date-span"},"cashOperations":{"type":["null","string"],"description":"Reuse of the cash operation reads: a customer's vouchers (bons), and the available amount of one voucher.","format":"date-span"}},"additionalProperties":false,"description":"How long Y2 answers are reused before Y2 is asked again, shared between the Cegid Y2 request and response\nbodies. Durations are `d.hh:mm:ss` strings, e.g. `00:05:00`; a null or zero duration does not cache\nthat lookup."},"CegidY2RateLimitSettings":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether calls are counted and limited. When false, calls go to Y2 unthrottled on this side. Default true.","default":true},"permitLimit":{"maximum":2147483647,"minimum":1,"type":"integer","description":"Maximum number of calls per window, at least 1. Default 4980. Cegid allows 5000 per 5 minutes on the\nAdvance plan, 20000 on the Dedicated plan.","format":"int32","default":4980},"windowSeconds":{"maximum":2147483647,"minimum":1,"type":"integer","description":"Length of the window Neo.Extensions.Cegid.Controllers.CegidY2RateLimitSettings.PermitLimit applies to, in seconds, at least 1. Default 300, Cegid's\nown window.","format":"int32","default":300},"retryAfterSeconds":{"maximum":2147483647,"minimum":0,"type":"integer","description":"Delay, in seconds, before a throttled call is tried again, used when Cegid's `Retry-After` header\nsupplies none. At least 0, default 60.","format":"int32","default":60},"queueAcquireTimeoutSeconds":{"maximum":2147483647,"minimum":0,"type":"integer","description":"Maximum time, in seconds, a call over the limit waits for a slot before failing. Default 0: such a call\nfails at once.","format":"int32","default":0},"queueRetryDelaySeconds":{"maximum":2147483647,"minimum":1,"type":"integer","description":"Interval, in seconds, at which a waiting call checks for a free slot, at least 1. Default 1. Used only when\nNeo.Extensions.Cegid.Controllers.CegidY2RateLimitSettings.QueueAcquireTimeoutSeconds is above 0.","format":"int32","default":1}},"additionalProperties":false,"description":"Client-side rate limiting of the calls to Y2, shared between the Cegid Y2 request and response bodies. Keeps\nthe calls to Y2 under the quota of the tenant's Cegid plan."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/extensions/cegid/y2":{"put":{"tags":["CegidY2"],"summary":"Set the Cegid Y2 configuration","description":"Creates or replaces the Cegid Y2 configuration; `connections` is the complete list.\nPasswords are matched to the stored connections by `name`: omit `password`, or\n`businessNotificationSettings.webServiceCredentials.password`, to keep the one stored for the\nconnection of the same name. Renaming a connection therefore requires its passwords again.\nWhen `updateCustomerOnPassInstallationChange`, `cache` or `rateLimit` is omitted, the stored\nvalue is kept; send `cache` without durations to disable caching.\nSaving registers the Y2 business notification subscription of every connection with\n`listenToBusinessNotification`, which disables any other active subscription on that Y2 database.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The configuration to store.","content":{"application/json":{"schema":{"description":"Request body for setting the Cegid Y2 configuration.","$ref":"#/components/schemas/SetCegidY2Request"}},"text/json":{"schema":{"description":"Request body for setting the Cegid Y2 configuration.","$ref":"#/components/schemas/SetCegidY2Request"}},"application/*+json":{"schema":{"description":"Request body for setting the Cegid Y2 configuration.","$ref":"#/components/schemas/SetCegidY2Request"}}},"required":true},"responses":{"204":{"description":"Configuration saved."},"400":{"description":"The body fails validation, two connections share a name, not exactly one connection\n            is the default, a password is missing and none is stored for that connection name, or a connection with\n            `listenToBusinessNotification` has no business notification credentials.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the <c>tenant.y2.settings:write</c> scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after <c>Retry-After</c>.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```


---

# 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/api-reference/advanced/cegid-y2.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.
