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

# Cegid

## Read a Y2 receipt

> Returns a summary of the receipt: \`items\` (one \`{ label, quantity, price }\` per line, the price\
> being the tax-included unit price), \`date\`, \`customerId\` (the Y2 customer id),\
> \`currencyId\` and \`total\` (tax included), amounts as Y2 holds them.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.y2.sandbox: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":{"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/sandbox":{"get":{"tags":["Cegid"],"summary":"Read a Y2 receipt","description":"Returns a summary of the receipt: `items` (one `{ label, quantity, price }` per line, the price\nbeing the tax-included unit price), `date`, `customerId` (the Y2 customer id),\n`currencyId` and `total` (tax included), amounts as Y2 holds them.","parameters":[{"name":"key","in":"query","description":"Y2 key of the receipt, as `{stump}-{number}`, e.g. `ST202-1409`. The number is the digits\nafter the last `-`; anything else is refused with 400.","schema":{"pattern":"(?<Stump>.*)-(?<Number>\\d+)","type":"string"}},{"name":"externalReference","in":"query","description":"External reference of the receipt in Y2; 404 when no receipt has it.","schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Receipt returned.","content":{"text/plain":{"schema":{}},"application/json":{"schema":{}},"text/json":{"schema":{}}}},"400":{"description":"The receipt is not designated by exactly one valid identifier.","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 sandbox read scope, or the sandbox is not enabled for the 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"}]}}}},"404":{"description":"Cegid Y2 is not configured for this tenant, or no receipt has the external\n            reference.","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"}]}}}}}}}}}
```

## Attach a Y2 receipt to a customer

> Finds the Y2 customer with the email, or creates one, then sets that customer on the receipt in Y2,\
> through the default Y2 connection. A created customer gets \`firstName\` and \`lastName\` from the\
> body; when absent, they are derived from the part of the email before \`@\`: \`jane.doe@…\` gives\
> \`jane\` and \`doe\`, a part without a dot is used for both.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.y2.sandbox: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":{"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/sandbox/attachReceiptToCustomer":{"post":{"tags":["Cegid"],"summary":"Attach a Y2 receipt to a customer","description":"Finds the Y2 customer with the email, or creates one, then sets that customer on the receipt in Y2,\nthrough the default Y2 connection. A created customer gets `firstName` and `lastName` from the\nbody; when absent, they are derived from the part of the email before `@`: `jane.doe@…` gives\n`jane` and `doe`, a part without a dot is used for both.","parameters":[{"name":"key","in":"query","description":"Y2 key of the receipt, as `{stump}-{number}`, e.g. `ST202-1409`. The number is the digits\nafter the last `-`; anything else is refused with 400.","schema":{"pattern":"(?<Stump>.*)-(?<Number>\\d+)","type":"string"}},{"name":"externalReference","in":"query","description":"External reference of the receipt in Y2; 404 when no receipt has it.","schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"JSON object with `email` (required string), and optional `firstName` and\n            `lastName` strings, used only when the customer is created.","content":{"application/json":{"schema":{}},"text/json":{"schema":{}},"application/*+json":{"schema":{}}}},"responses":{"200":{"description":"Customer found or created and attached to the receipt.","content":{"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"string"}},"text/json":{"schema":{"type":"string"}}}},"400":{"description":"The receipt is not designated by exactly one valid identifier, or the body has no\n            `email` string, or a `firstName` or `lastName` that is not a string.","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 sandbox write scope, or the sandbox is not enabled for the 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"}]}}}},"404":{"description":"Cegid Y2 is not configured for this tenant, or no receipt has the external\n            reference.","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"}]}}}},"502":{"description":"Cegid Y2 refused to attach the customer to the receipt."}}}}}}
```

## List Cegid civilities (titles)

> The civilities defined in Y2, as Y2 returns them. A customer's \`title\` is sent to Y2 as a civility\
> \`id\`.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"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":{"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/settings/civilities":{"get":{"tags":["Cegid"],"summary":"List Cegid civilities (titles)","description":"The civilities defined in Y2, as Y2 returns them. A customer's `title` is sent to Y2 as a civility\n`id`.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Civilities returned."},"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"}]}}}}}}}}}
```

## List Cegid countries and regions

> One entry per Y2 country, carrying \`id\`, \`languageId\`, \`shortDescription\`,\
> \`description\`, \`currencyId\`, \`nationality\`, \`isoCode\` (\`isO3NumCode\`,\
> \`isO2AlphaNumCode\`, \`isO3AlphaNumCode\`; null when Y2 has none) and \`regions\`, the Y2\
> regions whose \`countryId\` is the country's \`id\`. A customer's \`country\` is sent to Y2 as the\
> ISO alpha-2 code.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"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":{"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/settings/countries":{"get":{"tags":["Cegid"],"summary":"List Cegid countries and regions","description":"One entry per Y2 country, carrying `id`, `languageId`, `shortDescription`,\n`description`, `currencyId`, `nationality`, `isoCode` (`isO3NumCode`,\n`isO2AlphaNumCode`, `isO3AlphaNumCode`; null when Y2 has none) and `regions`, the Y2\nregions whose `countryId` is the country's `id`. A customer's `country` is sent to Y2 as the\nISO alpha-2 code.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Countries and regions returned."},"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"}]}}}}}}}}}
```

## Verify country ISO code uniqueness

> Finds the ISO alpha-2 codes shared by several Y2 countries. Customers' countries are sent to Y2 as ISO\
> alpha-2 codes, so such a code is ambiguous for Y2. Only the alpha-2 code is checked; countries without one\
> are left out.\
> &#x20;           \
> The body is \`{ "duplicatedCountries": { "simpleData": \[...], "fullData": \[...] } }\`:\
> \`simpleData\` holds one \`{ iso2, values: \[{ id, shortDescription }] }\` per shared code, and\
> \`fullData\` one array of complete Y2 countries per shared code, in the same order. Both are empty when\
> every code is unique.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"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":{"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/settings/countries/test":{"get":{"tags":["Cegid"],"summary":"Verify country ISO code uniqueness","description":"Finds the ISO alpha-2 codes shared by several Y2 countries. Customers' countries are sent to Y2 as ISO\nalpha-2 codes, so such a code is ambiguous for Y2. Only the alpha-2 code is checked; countries without one\nare left out.\n            \nThe body is `{ \"duplicatedCountries\": { \"simpleData\": [...], \"fullData\": [...] } }`:\n`simpleData` holds one `{ iso2, values: [{ id, shortDescription }] }` per shared code, and\n`fullData` one array of complete Y2 countries per shared code, in the same order. Both are empty when\nevery code is unique.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Report returned, possibly empty."},"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"}]}}}}}}}}}
```

## List Cegid supported languages

> The languages defined in Y2, as Y2 returns them.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"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":{"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/settings/languages":{"get":{"tags":["Cegid"],"summary":"List Cegid supported languages","description":"The languages defined in Y2, as Y2 returns them.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Languages returned."},"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"}]}}}}}}}}}
```

## List all Cegid Y2 stores

> Returns every Y2 store as Y2 sends it, unpaged and unfiltered.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.y2.store: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":{"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/stores":{"get":{"tags":["Cegid"],"summary":"List all Cegid Y2 stores","description":"Returns every Y2 store as Y2 sends it, unpaged and unfiltered.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Stores returned."},"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.store: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"}]}}}}}}}}}
```

## Redirect to LiveStore customer form

> Where LiveStore sends the associate's browser. Redirects to the tenant's LiveStore customer form, opened\
> for the session's customer, passing on every other query parameter. In tablet mode, the form opens in\
> tablet mode.\
> &#x20;           \
> A \`storeId\` value of the form \`530?sessionId=xxx\` is read as \`storeId=530\` and\
> \`sessionId=xxx\`.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"paths":{"/api/{tenantId}/external/livestore":{"get":{"tags":["Cegid"],"summary":"Redirect to LiveStore customer form","description":"Where LiveStore sends the associate's browser. Redirects to the tenant's LiveStore customer form, opened\nfor the session's customer, passing on every other query parameter. In tablet mode, the form opens in\ntablet mode.\n            \nA `storeId` value of the form `530?sessionId=xxx` is read as `storeId=530` and\n`sessionId=xxx`.","parameters":[{"name":"model","in":"query","description":"Every query parameter. `sessionId` identifies the session opened with a POST to `session`.","style":"deepObject","schema":{"type":"object","additionalProperties":{"type":"string"}}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No `sessionId` was sent (connection check); nothing is done."},"302":{"description":"Redirect to the customer form."},"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"}]}}}},"503":{"description":"LiveStore is not configured for this tenant."}}}}},"components":{"schemas":{"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":{}}}}}
```

## Check LiveStore session endpoint

> Answers GET or HEAD so LiveStore can check that the endpoint is reachable. Has no effect.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"paths":{"/api/{tenantId}/external/livestore/session":{"get":{"tags":["Cegid"],"summary":"Check LiveStore session endpoint","description":"Answers GET or HEAD so LiveStore can check that the endpoint is reachable. Has no effect.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"The endpoint is reachable."},"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"}]}}}}}}}},"components":{"schemas":{"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":{}}}}}
```

## Open LiveStore session

> Called by Cegid LiveStore before it sends the associate to the form. The session is valid for one hour from\
> this call; posting again under the same sessionId replaces the customer and restarts the\
> hour. An expired session no longer opens the form.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.livestore.access: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":{"CustomerPayload":{"required":["callbackUrl"],"type":"object","properties":{"callbackUrl":{"type":"string","description":"Base URL of the LiveStore instance that opened the session. Once the holder's account is saved, the form\nredirects to `{callbackUrl}/customers/{customerId}`."},"customerId":{"type":["null","string"],"description":"Identifier of the customer in the retail system LiveStore works with (Y2 or UR, per the tenant's LiveStore\nconfiguration). Set on the account as `id.y2.customerId` or `id.ur.customerId`;\nwhen absent, the account gets no customer identifier from the session."},"storeId":{"type":["null","string"],"description":"Store the session is opened in. The `storeId` query parameter, when sent, replaces it."}},"additionalProperties":{},"description":"The customer a Cegid LiveStore session is opened for."},"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}/external/livestore/session":{"post":{"tags":["Cegid"],"summary":"Open LiveStore session","description":"Called by Cegid LiveStore before it sends the associate to the form. The session is valid for one hour from\nthis call; posting again under the same sessionId replaces the customer and restarts the\nhour. An expired session no longer opens the form.","parameters":[{"name":"sessionId","in":"query","description":"Identifier LiveStore chose for the session; the form is later opened with it. Required.","schema":{"type":"string"}},{"name":"storeId","in":"query","description":"Store the session is opened in. When sent, replaces `storeId` of the body.","schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The customer the session is opened for.","content":{"application/json":{"schema":{"description":"The customer a Cegid LiveStore session is opened for.","$ref":"#/components/schemas/CustomerPayload"}},"text/json":{"schema":{"description":"The customer a Cegid LiveStore session is opened for.","$ref":"#/components/schemas/CustomerPayload"}},"application/*+json":{"schema":{"description":"The customer a Cegid LiveStore session is opened for.","$ref":"#/components/schemas/CustomerPayload"}}}},"responses":{"200":{"description":"Session stored."},"400":{"description":"`sessionId` or `callbackUrl` is missing.","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.livestore.access: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"}]}}}}}}}}}
```

## Check LiveStore session endpoint

> Answers GET or HEAD so LiveStore can check that the endpoint is reachable. Has no effect.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"paths":{"/api/{tenantId}/external/livestore/session":{"head":{"tags":["Cegid"],"summary":"Check LiveStore session endpoint","description":"Answers GET or HEAD so LiveStore can check that the endpoint is reachable. Has no effect.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"The endpoint is reachable."},"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"}]}}}}}}}},"components":{"schemas":{"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":{}}}}}
```

## List the Y2 business notification subscriptions

> Returns every subscription Y2 reports as active for the connection's database, this platform's own\
> included, to check where Y2 sends its notifications.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.y2.listener: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":{"SubscriptionInformation":{"required":["filters","headers","id","name","url","user"],"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether Y2 currently delivers to this subscription. Registering this platform's subscription disables\nanother enabled one."},"id":{"type":"string","description":"Y2 identifier of the subscription."},"name":{"type":"string","description":"Name of the subscription in Y2."},"url":{"type":"string","description":"URL Y2 posts the notifications to. For this platform's subscription, it ends with\n`/api/{tenantId}/webhooks/listeners/cegid/{connection name}`."},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"HTTP headers Y2 adds to each notification, by name."},"user":{"description":"Credentials Y2 sends with each notification.","$ref":"#/components/schemas/UserInformation"},"filters":{"type":"array","items":{"description":"A Y2 rule selecting the notifications the subscription delivers or drops.","$ref":"#/components/schemas/FilterInformation"},"description":"Rules selecting the notifications delivered; empty when Y2 has none."}},"additionalProperties":false,"description":"A Y2 business notification subscription: where Y2 sends its notifications for a database, and which ones."},"UserInformation":{"type":"object","properties":{"userName":{"type":["null","string"],"description":"User Y2 authenticates the delivery with; empty when none."}},"additionalProperties":false,"description":"Credentials Y2 sends with each notification."},"FilterInformation":{"type":"object","properties":{"eventSources":{"type":["null","array"],"items":{"type":"string"},"description":"Y2 service operations the filter matches, in the form of `Header.EventSource`, e.g.\n`Cegid.Retail.Services.ThirdParties.Customers.ICustomerService.Update`."},"userIds":{"type":["null","array"],"items":{"type":"string"},"description":"Y2 users the filter matches, in the form of `Header.UserId`: the user whose action raised the\nnotification."},"action":{"description":"Whether a matching notification is delivered or dropped.","$ref":"#/components/schemas/FilterAction"}},"additionalProperties":false,"description":"A Y2 rule selecting the notifications the subscription delivers or drops."},"FilterAction":{"enum":[0,1],"type":"integer","description":"What Y2 does with a notification the filter matches.","format":"int32"},"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}/webhooks/listeners/cegid/{connectionId}":{"get":{"tags":["Cegid"],"summary":"List the Y2 business notification subscriptions","description":"Returns every subscription Y2 reports as active for the connection's database, this platform's own\nincluded, to check where Y2 sends its notifications.","parameters":[{"name":"connectionId","in":"path","description":"`name` of the Y2 connection whose database is read.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Subscriptions returned, possibly none.","content":{"text/plain":{"schema":{"type":"array","items":{"description":"A Y2 business notification subscription: where Y2 sends its notifications for a database, and which ones.","$ref":"#/components/schemas/SubscriptionInformation"}}},"application/json":{"schema":{"type":"array","items":{"description":"A Y2 business notification subscription: where Y2 sends its notifications for a database, and which ones.","$ref":"#/components/schemas/SubscriptionInformation"}}},"text/json":{"schema":{"type":"array","items":{"description":"A Y2 business notification subscription: where Y2 sends its notifications for a database, and which ones.","$ref":"#/components/schemas/SubscriptionInformation"}}}}},"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.listener: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, or no Y2 connection has this name.","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"}]}}}},"409":{"description":"The connection has no business notification credentials; set\n            `businessNotificationSettings.webServiceCredentials` in the Cegid Y2 configuration.","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"}]}}}}}}}}}
```

## Process Cegid Y2 business notifications

> Called by Y2. \`Header.EventSource\` decides the handling; each recognised notification is re-emitted\
> as a platform event:\
> \<list type="bullet">\<item>\`…ThirdParties.Customers.ICustomerService.Create\`: \`Y2:BusinessNotification:CustomerCreated\`;\
> passes are not updated.\</item>\<item>\`…ThirdParties.Customers.ICustomerService.Update\`: \`Y2:BusinessNotification:CustomerUpdated\`;\
> the passes whose \`y2.customerId\` identifier is \`Body.Key.CustomerId\` are updated.\</item>\<item>\`…ISaleAndSellersService.CreateReceipt\`, \`…Engine.RegisterSale\`,\
> \`…Documents.Sales.ISaleService.Create\` and \`…ManagementService.CreateFrom\`:\
> \`Y2:BusinessNotification:ReceiptCreated\`; the passes of the sale document's customer are updated.\
> A receipt on hold updates no pass. \`Body.Key\` may be wrapped in a second \`Key\`.\</item>\<item>\`…ILoyaltyEngineService.AddCardOperations\`: \`Y2:BusinessNotification:LoyaltyUpdated\`; the\
> passes of the card's customer are updated.\</item>\<item>Any other source: \`Y2:BusinessNotification:Generic\`, with the body untouched.\</item>\</list>\
> Body properties are matched case-insensitively.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.y2.listener: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":{"GenericEventData":{"type":"object","allOf":[{"description":"A Y2 business notification: what happened, and the key of the entity it happened to.","$ref":"#/components/schemas/DataWrapper_JsonElement"}],"additionalProperties":false,"description":"A Y2 business notification as Y2 posts it, with its body left as raw JSON. Also the payload of the\n`Y2:BusinessNotification:Generic` event, emitted for an event source with no dedicated handling."},"DataWrapper_JsonElement":{"required":["Body","Header"],"type":"object","properties":{"__id":{"type":"string","description":"See . A new GUID when the event is raised."},"__creationDate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","format":"int64"}],"description":"See . The current UTC time when the event is raised. Accepts ISO 8601 date-time string or Unix epoch seconds in request inputs. Responses are serialized as ISO 8601 date-time strings."},"__eventName":{"type":"string"},"Header":{"description":"What happened, where and by whom.","$ref":"#/components/schemas/Header"},"Body":{"description":"Key of the entity the notification is about, under `Key`. Its shape depends on\n`Header.EventSource`."}},"additionalProperties":false,"description":"A Y2 business notification: what happened, and the key of the entity it happened to."},"Header":{"required":["ContentType","EventId","EventSource","SourceId","UserId"],"type":"object","properties":{"EventId":{"type":"string","description":"Y2 identifier of the notification. Carried into the emitted event."},"EventSource":{"type":"string","description":"Y2 service operation that raised the notification, e.g.\n`Cegid.Retail.Services.ThirdParties.Customers.ICustomerService.Update`. Decides how the\nnotification is handled and which shape `Body` must have."},"ContentType":{"type":"string","description":"Y2 service operation that reads the entity designated by `Body`, e.g.\n`…ICustomerService.GetCustomerDetail`. Carried into the emitted event."},"SourceId":{"type":"string","description":"System that raised the notification, `Y2`. Carried into the emitted event."},"UserId":{"type":"string","description":"Y2 user whose action raised the notification. Carried into the emitted event."},"Date":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","format":"int64"}],"description":"When Y2 raised the notification, in UTC. Carried into the emitted event. Accepts ISO 8601 date-time string or Unix epoch seconds in request inputs. Responses are serialized as ISO 8601 date-time strings."}},"additionalProperties":false,"description":"Header of a Y2 business notification."},"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}/webhooks/listeners/cegid/{connectionId}":{"post":{"tags":["Cegid"],"summary":"Process Cegid Y2 business notifications","description":"Called by Y2. `Header.EventSource` decides the handling; each recognised notification is re-emitted\nas a platform event:\n<list type=\"bullet\"><item>`…ThirdParties.Customers.ICustomerService.Create`: `Y2:BusinessNotification:CustomerCreated`;\npasses are not updated.</item><item>`…ThirdParties.Customers.ICustomerService.Update`: `Y2:BusinessNotification:CustomerUpdated`;\nthe passes whose `y2.customerId` identifier is `Body.Key.CustomerId` are updated.</item><item>`…ISaleAndSellersService.CreateReceipt`, `…Engine.RegisterSale`,\n`…Documents.Sales.ISaleService.Create` and `…ManagementService.CreateFrom`:\n`Y2:BusinessNotification:ReceiptCreated`; the passes of the sale document's customer are updated.\nA receipt on hold updates no pass. `Body.Key` may be wrapped in a second `Key`.</item><item>`…ILoyaltyEngineService.AddCardOperations`: `Y2:BusinessNotification:LoyaltyUpdated`; the\npasses of the card's customer are updated.</item><item>Any other source: `Y2:BusinessNotification:Generic`, with the body untouched.</item></list>\nBody properties are matched case-insensitively.","parameters":[{"name":"connectionId","in":"path","description":"`name` of the Y2 connection the subscription was registered for.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The notification as Y2 sends it.","content":{"application/json":{"schema":{"description":"A Y2 business notification as Y2 posts it, with its body left as raw JSON. Also the payload of the\n`Y2:BusinessNotification:Generic` event, emitted for an event source with no dedicated handling.","$ref":"#/components/schemas/GenericEventData"}},"text/json":{"schema":{"description":"A Y2 business notification as Y2 posts it, with its body left as raw JSON. Also the payload of the\n`Y2:BusinessNotification:Generic` event, emitted for an event source with no dedicated handling.","$ref":"#/components/schemas/GenericEventData"}},"application/*+json":{"schema":{"description":"A Y2 business notification as Y2 posts it, with its body left as raw JSON. Also the payload of the\n`Y2:BusinessNotification:Generic` event, emitted for an event source with no dedicated handling.","$ref":"#/components/schemas/GenericEventData"}}}},"responses":{"200":{"description":"Notification accepted and its event emitted."},"400":{"description":"The body cannot be read as the shape its event source requires.","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.listener:write</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, or no Y2 connection has this name.","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"}]}}}}}}}}}
```

## Register the Y2 business notification subscription

> Makes Y2 push its business notifications for the connection's database to this platform. As Y2 delivers\
> to a single subscription, another enabled subscription on that database is disabled. This platform's\
> subscription is created or updated to call \`…/webhooks/listeners/cegid/{connectionId}\`.\
> Saving the Cegid Y2 configuration does the same for every connection with\
> \`listenToBusinessNotification\`.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Cegid"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.y2.listener: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":{"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}/webhooks/listeners/cegid/{connectionId}/Register":{"post":{"tags":["Cegid"],"summary":"Register the Y2 business notification subscription","description":"Makes Y2 push its business notifications for the connection's database to this platform. As Y2 delivers\nto a single subscription, another enabled subscription on that database is disabled. This platform's\nsubscription is created or updated to call `…/webhooks/listeners/cegid/{connectionId}`.\nSaving the Cegid Y2 configuration does the same for every connection with\n`listenToBusinessNotification`.","parameters":[{"name":"connectionId","in":"path","description":"`name` of the Y2 connection to register the subscription for.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Subscription registered."},"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.listener:write</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, or no Y2 connection has this name.","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"}]}}}},"409":{"description":"The connection has no business notification credentials; set\n            `businessNotificationSettings.webServiceCredentials` in the Cegid Y2 configuration.","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"}]}}}}}}}}}
```


---

# 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/extensions/cegid.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.
